当我使用该函数将两个数字相加时,它看起来像 (2+2=22) 一样彼此相邻,尽管它与其他数学运算符(* 和 /)配合得很好
<html>
<head>
<title>Adding</title>
</head>
<body>
<input type="number" id="one">
<input type="number" id="two">
<button id="press">seed</button>
<script type="text/javascript">
function adding (a, b){
return (a + b);
}
document.getElementById("press").onclick = function(){
var first = document.getElementById("one").value;
var second = document.getElementById("two").value;
alert(adding(first, second));
}
</script>
</body>
Cats萌萌
RISEBY
拉丁的传说
相关分类