<html>
<body>
<input type="number" id="myNumber" value="2">
<p>点击按钮修改 number 字段的数值。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myNumber").value = "16";
}
</script>
</body>
</html>