zoukankan      html  css  js  c++  java
  • 自制计算器

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>自制计算器</title>
        <script src="add.js" type="text/javascript"></script>
    </head>
    <body>
        <div align="center" style="margin-top: 60px">
            <img src="add.png">
        </div>
        <div align="center" style="margin-top: 80px">
            <form name="form1">
                <input type="text" name="add1" placeholder="add1">+
                <input type="text" name="add2" placeholder="add2">=
                <input type="text" readonly="readonly" name="result" placeholder="result">
                <input type="button" name="submit" value="计算" onclick="add()">
            </form>
        </div>
    
    </body>
    </html>
    
    
    /**
     * Created by Administrator on 2018/2/18.
     */
    
    function add() {
        var add1 = Number(document.form1.add1.value);
        var add2 = Number(document.form1.add2.value);
        var result = add1 + add2
        document.form1.result.value=result
    }
  • 相关阅读:
    C#数组添加元素
    C#数组排序方法
    C#遍历数组
    C#动态数组ArrayList
    C#传递数组参数
    基础题(四)
    基础题(三)
    CMDB概述(二)
    CMDB概述(一)
    Django(基础篇)
  • 原文地址:https://www.cnblogs.com/themost/p/8453107.html
Copyright © 2011-2022 走看看