<html>
<title>jQuery Summing</title>
<head>
<script type="text/javascript" src="http://a...content-available-to-author-only...s.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script>
$(document).ready(function() {
$('.calc').on('input', function() {
var t1 = document.getElementById('txt1');
var t2 = document.getElementById('txt2');
var tot=0;
if (parseInt(t1.value))
tot += parseInt(t1.value);
if (parseInt(t2.value))
tot += parseInt(t2.value);
document.getElementById('txt3').value = tot;
});
});
</script>
</head>
<body>
<input type='text' class='calc' id='txt1'>
<input type='text' class='calc' id='txt2'>
<input type='text' id='txt3' readonly>
</body>
</html>
PGh0bWw+Cgk8dGl0bGU+alF1ZXJ5IFN1bW1pbmc8L3RpdGxlPgoJPGhlYWQ+CgkJPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiIHNyYz0iaHR0cDovL2EuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnMuY29tL2FqYXgvbGlicy9qcXVlcnkvMS44LjMvanF1ZXJ5Lm1pbi5qcyI+IDwvc2NyaXB0PgoJCSQoZG9jdW1lbnQpLnJlYWR5KGZ1bmN0aW9uKCkgewoJCQkkKCcuY2FsYycpLm9uKCdpbnB1dCcsIGZ1bmN0aW9uKCkgewoJCQkJdmFyIHQxID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3R4dDEnKTsKCQkJCXZhciB0MiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd0eHQyJyk7CgkJCQl2YXIgdG90PTA7CgkJCQlpZiAocGFyc2VJbnQodDEudmFsdWUpKQoJCQkJCXRvdCArPSBwYXJzZUludCh0MS52YWx1ZSk7CgkJCQlpZiAocGFyc2VJbnQodDIudmFsdWUpKQoJCQkJCXRvdCArPSBwYXJzZUludCh0Mi52YWx1ZSk7CgkJCQlkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgndHh0MycpLnZhbHVlID0gdG90OwoJCQl9KTsKCQl9KTsKCQk8L3NjcmlwdD4KCTwvaGVhZD4KCTxib2R5PgoJCTxpbnB1dCB0eXBlPSd0ZXh0JyBjbGFzcz0nY2FsYycgaWQ9J3R4dDEnPgoJCTxpbnB1dCB0eXBlPSd0ZXh0JyBjbGFzcz0nY2FsYycgaWQ9J3R4dDInPgoJCTxpbnB1dCB0eXBlPSd0ZXh0JyBpZD0ndHh0MycgcmVhZG9ubHk+Cgk8L2JvZHk+CjwvaHRtbD4K