Undefined error getting parents childs input value
<p>I have a table that looks like this:</p>

<pre><code>&lt;table&gt;
    &lt;tr&gt;
       &lt;td class="packing-vol"&gt;0.19&lt;/td&gt;
       &lt;td class="qty-cell"&gt;&lt;input type="text" name="qty[]" class="qty" value="2" /&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
       &lt;td class="packing_total"&gt;0.70&lt;/td&gt;
       &lt;td class="qty-cell"&gt;&lt;input type="text" name="qty[]" class="qty" value="1" /&gt;&lt;/td&gt;
     &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I'm looping through each occurence of .packing-vol getting it's text, then I want to get the qty from the same row so I go up to it's parent then drill into the .qty class. But when I alert(qty) i get 'undefined' message.</p>

<pre><code>var total = 0;

jQuery('.packing-vol').each(function(i) {

    var qty = jQuery(this).parent("td.qty-cell .qty").val();
    alert(qty);

    var cur = parseFloat(jQuery(this).text());
    if(!isNaN(cur)){
        total = total + cur;
    }

});
</code></pre>
