Tuesday, August 31, 2010

jQuery checkbox state

Markup (html)

< id="chkMatchedSets" type="checkbox">

Javascript (jQuery)

var ischecked = $("#chkMatchedSets").is(':checked');

markup:



javascript:



firebug:



end

2 comments:

fc said...
This comment has been removed by the author.
fc said...

To uncheck a checkbox use:

$("#chkMatchedSets").attr("checked", false);

You can also used the following one but I have not tried it:
$("#chkMatchedSets").removeAttr("checked");