There is several bad thing in your coding.
function functn() {
var a = document.getElementById('TextBox1').value;
var b = document.getElementById('TextBox2').value;
if (a == "")
a = 0;
else if (b == "")
b = 0;
var res = parseInt(a) + parseInt(b);
if (!NaN(res)) {
document.getElementById('TextBox3').value = res;
}
else
document.getElementById('TextBox3').value = 0;
}
How to debug: I use three software to debug web related issues
1. Firefox : (ctrl+shift+k)
2. Chrome : (ctrl+shift+j)
3. Internet Explorer(11); occasionally(F12)
so, open, say Chrome, press ctrl+shift+j
and then write, in the newly opened console, functn()
press enter
you will see your function error;
anyway, give it a shot.