How do you add functions to a jQuery object?
<p>Let's say I have a <code>&lt;ul&gt;</code> list:</p>

<pre><code>&lt;ul class="products"&gt;
    ...
&lt;/ul&gt;
</code></pre>

<p>I want to select it with jQuery, then add some functions to that object. For example, I'd like to add an <code>addProduct(productData)</code> function and a <code>deleteProduct(productId)</code> function. However, I'd like the functions to only be added to the object that's returned by the selector. So for example, something like this:</p>

<pre><code>var productList = $.extend($('ul.products'), {
    addProduct: function(productData) {
        // add a new li item
    },
    deleteProduct: function(productId) {
        // delete li with id
    }
});
</code></pre>

<p>How would I do this using jQuery? The key point here is that I only want to add the functions to an instance returned by a jQuery selector. In other words, I don't want to modify jQuery's prototype or create a plugin, since those will make the functions available across everything, whereas I only want to add the functions to one specific instance.</p>
