取消 input 的方法有两种:1. 手动清除输入值;2. 使用 reset 按钮。

取消 input 的方法
如何取消 input?
取消 input 的方法有两种:
1. 手动清除输入值
<code class="html">document.getElementById("myInput").value = "";</code>2. 使用 reset 按钮
<code class="html"><form> <input type="text" id="myInput"> <input type="reset" value="重置"> </form></code>
当用户点击重置按钮时,表单中的所有输入值都会被清除。










