Brad Bansner
asked on
jQuery: selecting a checkbox by DIV, class and checked status
If I have these elements:
<div id="question1">
<input type="checkbox" class="answerCheckbox" value="1" />
</div>
...I can select the box, only if it is checked, like this:
$('#question1 :checkbox:checked')
But, how can I also add the class to make sure any other checkboxes are not selected? I tried this:
$('#question1 .answerCheckbox :checkbox:checked')
...but that did not work. Thanks!
<div id="question1">
<input type="checkbox" class="answerCheckbox" value="1" />
</div>
...I can select the box, only if it is checked, like this:
$('#question1 :checkbox:checked')
But, how can I also add the class to make sure any other checkboxes are not selected? I tried this:
$('#question1 .answerCheckbox :checkbox:checked')
...but that did not work. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER