I am not sure if "concatenate" is the correct term for it, but something like this:
$("#a").$("#b").$("#c").$("#d").click(); // click on all of them
Basically I have a long list of stuff but I can't apply a class to them.
I am not sure if "concatenate" is the correct term for it, but something like this:
$("#a").$("#b").$("#c").$("#d").click(); // click on all of them
Basically I have a long list of stuff but I can't apply a class to them.
As in CSS, you can use a comma to separate multiple selectors:
$("#a, #b, #c, #d").click();
Note that these do not have to be the same kind of selector. For example:
// Click the menu, all spans in all .foo, and paragraphs after headers
$("#menu, div.foo span, h1 + p").click();
Also, if you already have the jQuery objects, you can add() the sets like so:
var a = $('#a'), b = $('#b'), c = $('#c');
var all = a.add(b).add(c);