If you are asking how to detect if a HTML checkbox is checked or not by using Jquery Javascript, you can do this with a simple example below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type='text/javascript' src='http://rapid-dev.net/wp-includes/js/jquery/jquery.js?ver=1.2.6'></script> </head> <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#chkNewProposal").click(function(){ if(jQuery('#chkNewProposal').is(':checked')) { alert("a: " + jQuery('#chkNewProposal').val()); } if(jQuery('#chkNewProposal').attr('checked')) { alert("b: " + jQuery('#chkNewProposal').val()); } }); }); </script> <body> <input type="checkbox" name="chkNewProposal" id="chkNewProposal" /> </body> </html> |