我如何使用 window 对象来添加/求和两个数字,我到目前为止得到的示例 - (我可以添加两个数字但不能让它等于总和?)
<html>
<head>
<script language="JavaScript">
var requestMsg = "Enter a number";
userInput1 = prompt(requestMsg);
requestMsg = "Enter another number here";
userInput2 = prompt(requestMsg);
alert(total = " You entered " + userInput1 + " + " + userInput2 + " which equals ");
</script>
<head>
<body>
</body>
</html>