function - jQuery and passing variables from decision structure -


i'm using jquery , i'm having issue passing variable function value of checkbox. can pass function switch statement, not if then. i'm looking assistance why.

 $("input[type=checkbox]").change( function() {  if($(this).is(":checked")){     passvar = ( $(this).val() );     addtoorder(passvar);     alert(passvar); } else {     alert("off"); }  }); 

any assistance appreciated.

its working fine. see fiddle

$("input[type=checkbox]").change( function() {  if($(this).is(":checked")){     passvar = ( $(this).val() );     alert(passvar);     addtoorder(passvar); } else {     alert("off"); }  });  function addtoorder(t) {     alert(t);     tempstring = t.split(",");      receipttext = receipttext + "<br>" + tempstring[0] + " - " + tempstring[1]; //alert(t); }  

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -