Okay, so I've been using JQuery for a while now, I'm in the process of going through some code and trying to make it a bit more shorthand (one JS file I'm working on is 2000+ lines of JQuery for one page :S).
Here's my question, is it possible to do something like an Or selector? Something like:
$("#element1Id and #element2Id")
I know I can pattern match that using
$("[id^=element][id&=Id]")
But the problem is, I have a LOT of stuff on the page that can match my ID selectors in question and I've always wondered if you could do a this or that, I've needed it in other situations.
Any ideas?
$('#element1Id, #element2Id')
Multiple Selector
Description: Selects the combined results of all the specified selectors.
You can specify any number of selectors to combine into a single result. This multiple expression combinator is an efficient way to select disparate elements. The order of the DOM elements in the returned jQuery object may not be identical, as they will be in document order. An alternative to this combinator is the .add() method.
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