Jquery :not() Selector
by Sasikumar[ Edit ] 2014-06-08 21:30:04
not() selector can be combined with jQuery selectors to achieve some difficult queries.
Examples:
:not('.className') – Ignores all the elements with class=”
className” from the selected list
:not('#idName') – Ignores the element with id=”
idName” from the selected list
:not('first-child') – Ignores the first child from the selected list
:not('only-child') – Ignores all the elements that are only child of their parents from the selected list
:not(':eq(n)') – Ignores the nth element from the selected list
:not(':even') – Ignores all even elements from the selected list
Usage Examples:
$('input[type=checkbox]:not(".myOddCheckBox")')
Selects all the checkbox without the class "myOddCheckBox".