In jQuery, selecting more than one element can be done like this:
$(\"#id1,#id2\").show();
But when I have two jQuery objects, I don\'t see
You can use add :
jqId1.add(jqId2).show();
But don't make your code too complex just to avoid querying "#id1,#id2"
: this selector relies on getElementById
and is very fast.
I know this sound a little stupid, but you can also try like this.
$([
jqId1.get(0),
jqId2.get(0),
jqId3.get(0),
... // more jQuery elements
]).show();
You can use each cycle:
$([jqId1, jqId2]).each( function(){
$(this).show();
});
As answered here: Select multiple jQuery objects with .add()