Merging jQuery objects
<p>Is it possible to merge several jQuery DOM objects into one array and call jQuery methods on all of them?</p>

<p>F.ex:</p>

<pre><code>&lt;button&gt;one&lt;/button&gt;
&lt;h3&gt;two&lt;/h3&gt;

&lt;script&gt;

var btn = $('button');
var h3 = $('h3');

$([btn,h3]).hide();

&lt;/script&gt;
</code></pre>

<p>This doesn't work. I know I can use the 'button,h3' selector here but in some cases I already have several jQuery DOM elements and I need to merge them so I can call jQuery prototypes on all of them.</p>

<p>something like:</p>

<pre><code>$.merge([btn,h3]).hide();
</code></pre>

<p>would work. Any ideas?</p>

<p><strong>UPDATE:</strong></p>

<p>Solved it. You can do it like this:</p>

<pre><code>$.fn.add.call(btn,h3);
</code></pre>

<p>I'm going to accept the <code>add()</code> suggestion as for pointing me in the right direction.</p>
