Quantcast
Channel: Check if checkbox is checked with jQuery - Stack Overflow
Viewing all articles
Browse latest Browse all 28

Answer by Vindicated Halcyon for Check if checkbox is checked with jQuery

$
0
0

Just to say in my example the situation was a dialog box that then verified the check box before closing dialog. None of above and How to check whether a checkbox is checked in jQuery? and jQuery if checkbox is checked did not appear to work either.

In the end

<input class="cb" id="rd" type="checkbox">
<input class="cb" id="fd" type="checkbox">

var fd=$('.cb#fd').is(':checked');
var rd= $('.cb#rd').is(':checked');

This worked so calling the class then the ID. rather than just the ID. It may be due to the nested DOM elements on this page causing the issue. The workaround was above.


Viewing all articles
Browse latest Browse all 28

Trending Articles