So...I'm trying to shrink down some JS code a bit, and I have things like...
$('#element-A'+idx).hide();
$('#element-R'+idx).hide();
$('#element-Z'+idx).hide();
Is there a reliable way I can smash these down into one statement without taking a performance hit?
I tried:
$('#element-A'+idx,'#element-R'+idx,'#element-Z'+idx).hide();
...but that just gave me an error, which actually is what I thought would happen.
I also tried:
$(['#element-A'+idx,'#element-R'+idx,'#element-Z'+idx]).hide();
...but I also got an error from that.
The only other possibility I can think of is:
$('#element-A'+idx).add('#element-R'+idx).add('#element-Z'+idx).hide();
But doesn't that create a new object, in effect taking up more memory??
What should I do?? Or am I better off just leaving them as separate commands?