Jquery sum each cell of textbox value?
<p>I'm having problem to sum each textbox value in a table cell. Here is the code I've written:</p>

<pre><code>&lt;asp:Table ID="table101" runat="server" CssClass="table100"&gt;
    &lt;asp:TableRow&gt;
        &lt;asp:TableCell&gt;Item 1 &lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;:&lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;
            &lt;cus:cusTextBox ID="txtCDesc0" runat="server" Action="View"  &gt;&lt;/cus:cusTextBox&gt;
        &lt;/asp:TableCell&gt;              
        &lt;asp:TableCell&gt;Cost: RM
            &lt;cus:cusTextBox ID="txtCCost0" runat="server" Action="Edit" class="cost"  CssClass="inputTextM" OnKeyUp="return calculateTotalCost()"&gt;&lt;/cus:cusTextBox&gt;                           
        &lt;/asp:TableCell&gt;                   
    &lt;/asp:TableRow&gt;

    &lt;asp:TableRow&gt;
        &lt;asp:TableCell&gt;Item 2&lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;:&lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;
            &lt;cus:cusTextBox ID="txtCDesc1" runat="server" Action="View"  &gt;&lt;/cus:cusTextBox&gt;
        &lt;/asp:TableCell&gt;              
        &lt;asp:TableCell&gt;Cost: RM
            &lt;cus:cusTextBox ID="txtCCost1" runat="server" Action="Edit" class="cost"  CssClass="inputTextM" OnKeyUp="return calculateTotalCost()"&gt;&lt;/cus:cusTextBox&gt;                           
        &lt;/asp:TableCell&gt;                   
    &lt;/asp:TableRow&gt;

    &lt;asp:TableRow&gt;
        &lt;asp:TableCell&gt;Item 3&lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;:&lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;
            &lt;cus:cusTextBox ID="txtCDesc2" runat="server" Action="View"  &gt;&lt;/cus:cusTextBox&gt;
        &lt;/asp:TableCell&gt;              
        &lt;asp:TableCell&gt;Cost: RM
            &lt;cus:cusTextBox ID="txtCCost2" runat="server" Action="Edit" class="cost"  CssClass="inputTextM" OnKeyUp="return calculateTotalCost()"&gt;&lt;/cus:cusTextBox&gt;                           
        &lt;/asp:TableCell&gt;                   
    &lt;/asp:TableRow&gt;

    &lt;asp:TableRow&gt;
        &lt;asp:TableCell&gt;Item 4 &lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;:&lt;/asp:TableCell&gt;
        &lt;asp:TableCell&gt;
            &lt;cus:cusTextBox ID="txtCDesc3" runat="server" Action="View"  &gt;&lt;/cus:cusTextBox&gt;
        &lt;/asp:TableCell&gt;              
        &lt;asp:TableCell&gt;Cost: RM
            &lt;cus:cusTextBox ID="txtCCost3" runat="server" Action="Edit" class="cost"  CssClass="inputTextM" OnKeyUp="return calculateTotalCost()"&gt;&lt;/cus:cusTextBox&gt;                           
        &lt;/asp:TableCell&gt;                   
    &lt;/asp:TableRow&gt;
</code></pre>

<p>My jQuery code:</p>

<pre><code>//--Calculate total cost--
function calculateTotalCost() {
    $('#&lt;%=table101.ClientID %&gt; tr').each(function () {
        var total;
        cost = parseFloat($(this).find("td").eq(3).find('input').val()).toFixed(2);
        total += cost;**//error**
        alert(total);
    });
}
//**Calculate total cost**
</code></pre>

<p>I am able to get each cell of textbox value, but not able to total each of the textbox values. Please help. This is an urgent problem. Thanks :)</p>
