title: Javascript returning NaN
body: <p>I'm attempting to display a subtotal each time a customer enters a quantity. However, when I loop through my inputs, I get a <code>NaN</code> as the total. I believe it may be the way I'm declaring the <code>subtotal</code> variable in my script, but I haven't come across this before:</p>
  
  <pre><code>$('.item-qty input').bind('keyup', function(){
  
     var subtotal = 0.0;
  
     $('.item-qty input').each(function(){
        var class = $(this).attr('id');
        var qty = $(this).val();                     
        var price = $('.'+class).html();
  
        price = parseFloat(price);
        qty = parseInt(qty);
        subtotal = subtotal + (price * qty);
     });
  
     $('.subtotal input').val(subtotal);
  });
  </code></pre>