Jquery : Product between 2 lists of inputs into a 3rd list <p>I don't have much experience in jQuery, I'm facing the following challenge</p> <p>I have the following table</p> <pre><code>&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;td&gt;Qty&lt;/td&gt; &lt;td&gt;Description&lt;/td&gt; &lt;td&gt;Unit Price&lt;/td&gt; &lt;td&gt;Total Price&lt;/td&gt; &lt;tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr id="itemRow"&gt; &lt;td&gt;&lt;input type="text" name="quantity"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="description"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="unitPrice"/&gt;/td&gt; &lt;td&gt;&lt;input type="text" name="totalPrice"/&gt;&lt;/td&gt; &lt;tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;input type="text" name="total"/&gt; </code></pre> <p>Additionally, I'm able to clone #itemRow as many times as required, enlarging the amount of items.</p> <p>The idea is to calculate the total price for each row (by <code>quantity</code> * <code>unitPrice</code>) and assign it to <code>totalPrice</code>. And assign the sum of <code>totalPrice</code> to <code>total</code>.</p> <p>This is the javascript I'm using, but I get an error that says "cantidades[i].val() is not a function"</p> <pre><code>function calculate(){ var $total = $('#total'); var $cantidades = $('input[name=quantity]') var $unitarios = $('input[name=unitPrice]') var $totales = $('input[name=totalPrice]') var len = $cantidades.length; $total.val(0); for (var i = 0; i &lt; len; i++){ // calculate total for the row. ERROR HERE! $totales[i].val($cantidades[i].val() * $unitarios[i].val()); // Accumulate total $total.val($totalExento.val() + $totales[i].val()); } } </code></pre> <p>What am I missing? I think I'm not getting "jQuery objects" from the selector but I'm not sure hot to do this. </p> <p>Thanks in advance!</p>