Select an array of elements in jQuery
<p>I need to wrap up an array of elements into a jQuery object as if they were selected so that I can call various jQuery actions on them.</p>

<p>I'm looking for a function like <code>foo</code> below that accepts an array of elements and returns a jQuery object with them in it.</p>

<pre><code>var elements = [element1, element2, element3];

$(foo(elements)).click(function() {
    ...
});
</code></pre>

<p>Can someone shed some light on this?</p>

<p>Thanks much.</p>
