count the textbox values using javascript
<p>I have dynamically added rows using javascript.now I have to sum the values in the text boxes.if i click add button the same row will be added.now i have one fixed textbox.if i enter the values in the textbox it should add and get displayed in the fixed textbox on keypress.how can i do this with javascript or jquery</p>

<p>here is my html and jquery scripts to addd the row</p>

<p>input id="name" type="text" 
 input id="add" type="button" value="+" 
 input id="Button1" type="button" onclick="removeRowFromTable();" value="x"           </p>

<p>I have used jquery to add the rows dynamically and javascript to delete the rows</p>

<pre><code>$(document).ready(function() 
{
$("#add").click(function() {
$('#mytable tbody&gt;tr:last').clone(true).insertAfter('#mytable tbody&gt;tr:last');

$('#mytable tbody&gt;tr:last #name').val('');
$("#mytable tbody&gt;tr:last").each(function() {this.reset();});      
return false;
return false;
    });
});
</code></pre>

<p>function removeRowFromTable()
{
var tbl = document.getElementById('mytable');
var lastRow = tbl.rows.length;
if (lastRow > 2) tbl.deleteRow(lastRow - 1);
}</p>
