I have a jQuery selector that looks like this ...
$(\"input:checkbox\").click(function(event) {
// DO STUFF HERE
}
Everything was working
Well.. we need to know more about the HTML for a specific answer, but there are two methods that I can think of.
1) if you know the name of the one that you don't want then remove that one with not
$("input:checkbox").not('#the_new_checkbox_id').click(function(event) {
// DO STUFF HERE
}
2) use something that the correct inputs have in common to select them.
$("input:checkbox[name=whatItIsNamed]").click(function(event) {
// DO STUFF HERE
}
You can do the following:
$("input:checkbox").not(":eq(0)")
being the "0" the index of your desired checkbox (in this case the first on the DOM)
$('input:checkbox:not("#thatCheckboxId")').click(function(event) {
// DO STUFF HERE
}
Just give the checkbox in question a unique id=""
If all the checkboxes are within another element, you can select all checkboxes within that element.
Here is an example with one parent element.
<div class="test"><input type="checkbox"><input type="checkbox"></div>
The jQuery below also works with multiple divs as well:
<div class="test"><input type="checkbox"><input type="checkbox"></div>
<div class="test"><input type="checkbox"><input type="checkbox"></div>
jQuery:
$('.test input:checkbox')
That selects just the checkboxes within any element with class "test".
-Sunjay03