标签:col alert nbsp javascrip res prompt java ext 计算
<script type="text/javascript"> var number1 = parseFloat(prompt("请输入第一个数值")); var fh = prompt("请输入符号"); var number2 = parseFloat(prompt("请输入第二个数值")); var result; if(fh == "+") { result = number1 + number2; } else if(fh == "-") { result = number1 - number2; } else if(fh == "*") { result = number1 * number2; } else if(fh == "/") { result = number1 / number2; } else if(fh == "%") { result = number1 % number2; } else { result = "请输入正确的"; } alert(result) </script>
标签:col alert nbsp javascrip res prompt java ext 计算
原文地址:https://www.cnblogs.com/smile6542/p/11873905.html