oninput="f()"
function f(){ var n1=+document.getElementById('i1').value||0; var n2=+document.getElementById('i2').value||0; document.getElementById('i3').value=n1+n2; }