JS弹框计算

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <script type="text/javascript">
        
        var owe=prompt("计算第一个值","");
        var oee=prompt("计算第二个值","");
        var oae=prompt("请输入运算符","");
        var sk;
         a=parseFloat(owe);
         d=parseFloat(oee);
        switch(oae){
            case "+":
            sk=a+d;
            break;
            case "-":
            sk=a-d;
            break;
            case "*":
            sk=a*d;
            break;
            case "/":
            sk=a/d;
            break;
        }
        alert("计算的数字是"+a+oae+d+"="+sk);
    </script>
    <body>
    </body>
</html>

 

JS弹框计算

上一篇:vue实现浏览器端大文件分片上传


下一篇:This request has been blocked; the content must be served over HTTPS