无解,这段代码为什么无法运行?
程序代码:
求,和的代码/??? <!doctype html> <html> <head> <meta charset="utf-8"> <title>I love Chen.....</title> <script> window.onload=function(){ var oTxt1 = document.getElementById("txt1"); var oTxt2 = document.getElementById("btn2"); var oBtn = document.getElementById("btn1"); oBtn.onclick = function(){ alert(parseInt(oTxt1.value) + parseInt(oTxt2.value)); }; }; </script> </head> <body> <input type="text" id="txt1" /> <input type="text" id="txt2" /> <input type="button" id="btn1" value="求和" /> </body> </html>