zoukankan      html  css  js  c++  java
  • 表单输入需求数量,自动生成总价格

    <html>
    <head>
    <meta charset="utf-8">
    <title></title>
    <style>
    * {margin: 0;padding:0}
    #Tb{480px ;margin: 20px auto ; border-collapse: collapse; border: 2px solid blue;}
    #Tb tr{height:28px;}
    #Tb th, #Tb td{border: 1px solid skyblue;120px;text-align: center;height: 30px;}
    #tx{height: 20px; 100px;}
    </style>
    </head>
    <body>
    <table id="Tb">
    <tr>
    <th>商品名称</th>
    <th>数量</th>
    <th>单价</th>
    <th>总价</th>
    </tr>
    <tr>
    <td>OPPO手机</td>
    <td><input type="text" id="tx" oninput="OnInput(event)"/> </td>
    <td >2399</td>
    <td id="output"></td>
    </tr>
    </table>
    <script type=“text/javascript”">

    window.alert("请输入需求数量");
    function OnInput (event) {
    document.getElementById("output").innerHTML=event.target.value*2399;
    }

    </script>
    </body>
    </html>

  • 相关阅读:
    文件操作类File
    文件流操作
    自动登录和解/加密
    redis---set类型常用命令
    div
    css2
    css-id选择器
    table标签
    段落标签-换行标签
    input-form-select-a-img-ul-dl标签
  • 原文地址:https://www.cnblogs.com/LLiRo/p/12583870.html
Copyright © 2011-2022 走看看