How do I get "I" to increment inside a .click function
<pre><code>$('#x').click(function() {
var i=1;

    $('#y').prepend('&lt;div id='+i+'&gt;x'+i+'&lt;/div&gt;');
    i++;        
});
</code></pre>

<p>I want the i to increment, now for some reason it is not.  I will agree this is a silly question.</p>
