Finding elements by attribute in jQuery is simple:
$(parentElement).find('[attribute]');
How do you find elements, that don't have a certain attribute?
That's why the :not()
is made for.
Try,
$(parentElement).find(':not([attribute])');
You can use :not
although filter
is most likely faster:
$(parentElement).filter(function() {
return !$(this).attr('attribute');
});
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