How do I assign sequential values over a jQuery collection?
<p>I feel like a bonehead: I want to assign <code>index=i</code> to each LI I have selected, with i incrementing. It appears to assign them all at once though, and they all get <code>index=1</code>. Thoughts?</p>

<pre><code>$("#window ul li").each(function(){
    var i = 1;
    $(this).attr("index", i);
    i++;
});
</code></pre>
