I have some code, that to my mind, should be finding all classes '.stock-input', adding their values together, and displaying that value in the id #pStockQuantity, I can't see why I'm getting the result NaN.
JS:
$('.stock-input').keyup(function() {
var stockTemp = parseInt(0);
$('.stock-input').each(function() {
stockTemp = parseInt(stockTemp) + parseInt($(this).val());
});
$('#pStockQuantity').val(stockTemp);
});
console.log(stockTemp)will tell you what you're getting. On a side note, since stockTemp is already an integer you can just dostockTemp += parseInt($(this).val())