CodePudding user response:
//the effect: simple addition.
//load event
Window. The onl oad=function () {
//to register for the click event
Document. The getElementById (' for '). The onclick=function () {
Var number1=document. GetElementById (' t1 '). The value;
Var number2=document. GetElementById (' t2 '). The value;
Document. The getElementById (" result "). The value=https://bbs.csdn.net/topics/parseInt (number1) + parseInt (number2);
};
};
</script>
<body>