<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
* {margin: 0;padding:0}
#Tb{width:480px ;margin: 20px auto ; border-collapse: collapse; border: 2px solid blue;}
#Tb tr{height:28px;}
#Tb th, #Tb td{border: 1px solid skyblue;width:120px;text-align: center;height: 30px;}
#tx{height: 20px;width: 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>
联系客服