Trying to number objects in jQuery
<p>I'm trying to number objects, which can be added to a cart with drag'n'drop. So, this snippet should check the current number written in <code>span.amountVal</code>, and easily add ´+1´ to this number, but the result is always ´1´. When I uncomment the ´alert(i++);´, the snippet work like I want to. I'm confused, what is this about?</p>

<pre><code>$.favList.find("div[data-asset-id="+ _itemID +"]").each(function() {
    var i = $(this).find("span.amountVal").text();

    // alert(i++);

    $(this).find("span.amountVal").text(i++);
});
</code></pre>

<p>Thank you.</p>
