I'm looking for a way to select all elements on a page, except those with a specified DOM location.. Here's an example of what I'd like to do:
jQuery('*').except('.ignore').bind('click', function(e) { ... });
Is this possible in a "native jQuery" way?
You want to use the :not()
selector:
jQuery(":not(.ignore)").bind("click", function(e) { ... });
Another way, if you already have selectors for both:
$('.foo').not('.ignore').bind(...);
Also, more filters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With