<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="th"><head>
<metacontent="text/html; charset=TIS-620" http-equiv="content-type">
<title>Super Calculator</title>
<script>
function doUpdate(){
var t1=document.f1.t1.value*1;
var t2=document.f1.t2.value*1;
document.f1.t3.value=t1+t2;
if (document.f1.t3.value=="NaN"){
document.f1.t3.value="0";
}
}
</script></head><body>
<form method="get" action="#" name="f1">
one <input name="t1" onkeyup="doUpdate()"><br>
two <input name="t2" onkeyup="doUpdate()"><br>
result <input readonly="readonly" name="t3"><br></span></form>