Looping through list items with jquery
<p>I have this block of code</p>

<pre><code>listItems = $("#productList").find("li");

        for (var li in listItems) {
            var product = $(li);
            var productid = product.children(".productId").val();
            var productPrice = product.find(".productPrice").val();
            var productMSRP = product.find(".productMSRP").val();

            totalItemsHidden.val(parseInt(totalItemsHidden.val(), 10) + 1);
            subtotalHidden.val(parseFloat(subtotalHidden.val()) + parseFloat(productMSRP));
            savingsHidden.val(parseFloat(savingsHidden.val()) + parseFloat(productMSRP - productPrice));
            totalHidden.val(parseFloat(totalHidden.val()) + parseFloat(productPrice));

        }
</code></pre>

<p>and I'm not getting the desired results - totalItems is coming out as 180+ and the rest all NaN. I suspect its where i use <code>var product = $(li);</code> or perhaps with the expression on the loop itself. Either way - I need to loop through the <code>&lt;li&gt;</code> items in the <code>&lt;ul&gt;</code> labelled <code>#productList</code></p>
