[jQuery] Is checkbox checked?
I'm having trouble trying to determine if a checkbox is checked or not using JQuery syntax. Here's the code:
alert($("#mismatch").checked);
alert($("#mismatch").val());
alert(document.getElementById
('mismatch').checked);
The first line gives me 'undefined'.
The second gives me the correct value of the checkbox.
The third gives me the correct 'checked' value.
What is the correct JQuery syntax to tell if a checkbox is checked or not?
(and val() needs to be added to the docs, it took me forever to find that).
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/