jQuery reducing code for better maintainability?
<p>In jQuery you can do </p>

<pre><code>$("#id1, #id2").doSomething();
</code></pre>

<p>But what if you have </p>

<pre><code>var $id1 = $("#id1");
var $id2 = $("#id2");
</code></pre>

<p>Is there a way to easily group them together and execute doSomething()?</p>

<pre><code>$($id1, $id2).doSomething(); //ERROR
</code></pre>

<p>Having only two elements is fine, but if I have like more than 10 elements. I would need to repeat doing...</p>

<pre><code>$id1.doSomething();
$id2.doSomething();
....
</code></pre>

<p>Is there a easy way to group them?</p>
