<html>
<body>
<table id='main'>
<tr>
<td>
Наименование
</td>
<td>
Цена
</td>
<td>
<input>
</td>
</tr>
<tr>
<td>
что-то
</td>
<td>
300
</td>
<td>
<input type='text' />
</td>
</tr>
<tr>
<td>
что-то
</td>
<td>
300
</td>
<td>
<input type='text' />
</td>
</tr>
<tr>
<td>
что-то
</td>
<td>
300
</td>
<td>
<input type='text' />
</td>
</tr>
</table>
<span id='summ'>0</span>
<script type='text/javascript'>
var elems = document.getElementById("main").getElementsByTagName("input"),
sm = document.getElementById("summ");
for (var i = 0, l = elems.length; i < l; i++)
elems[i].onblur = function () {
var val = this.value, price = this.parentNode.parentNode.cells[1].innerHTML,
res = +val.replace(/\s/g, "") * +price.replace(/\s/g, "");
if (res === res) { // проверка от Nan
this.value = res;
var s = 0;
for (var j = 0; j < elems.length; j++)
s += +elems[j].value;
sm.innerHTML = s;
}
};
</script>
</body>
</html>