Is there a nice way to accomplish filtering selected elements down to a few classes? I know I could do them one at a time, but this just seemed to be something jQuery would allow.
These are being served up with ajax, and I don't have access to define the actual html.
$('.val>td').each(function () {
$(this).filter('.price,.quantity,.remove').children().children().addClass('hidetaxfields');
});
What you are asking isnt clear from the exmple you give...
This will produce a subset of the elements matched by the inital selector that have the class one
OR two
:
$(selector).filter('.one, .two');
This will produce a subset of the elements matched by the inital selector that have BOTH the classes one
AND two
:
$(selector).filter('.one.two');
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