Using .toggle() jquery -


I have this jquery code, and want to toggle it. When I use

  $ ('# checkb'). Toggle (function ()});  

does not toggle it

  $ ('# checkb'). Bind ('click', function) {var PackagePrice = $ ('# text (); var quantity = $ (' # specs_quantity '). Text (); var item = $ (' # specs_itempr '). Text (); Var unit = $ ('# specs_unit'). Text (); var calc = unit * item effect; $ ('# last_woa'). Text (calc);});   

>

  $ ('# checkb'). Toggle (function () {// click also var packageprice = $ ('# specs_packageprice'). Text (); var volume = $ ('# specs_quantity') .text (); var madpris = $ ('# glasses_itemp ''; Unit = $ ('# glasses_out'). Text (); var calc = unit * item process; $ ('# last_name') .text (calc);}, function () {// Every funny click // something here)};  

Edit: Google seems to be messing with the checkbox you can try

  $ ('# checkb '). Click (function () {if ($ (this) .attr ("checked")) {// do stuff if checkbox is checked} else {// do stuff if checkbox is not checked}  

);


Comments