Loading... 事件处理代码表单中的值重置为其初始值。 ``` <form> <div class="controls"> <label for="id">User ID:</label> <input type="text" id="id" name="id" /> <input type="reset" value="Reset"> <input type="submit" value="Submit"> </div> </form> ``` ``` .output { font: 1rem 'Fira Sans', sans-serif; } .controls { padding-top: 1rem; display: grid; grid-template-rows: repeat(3, 1fr); grid-template-columns: 1fr 2fr; gap: .7rem; } label { font-size: .8rem; justify-self: end; } input[type='reset'], input[type='submit'] { width: 5rem; justify-self: end; } input[type='reset'] { grid-column: 2; grid-row: 2; } input[type='submit'] { grid-column: 2; grid-row: 3; } ``` 侵删转自:[https://developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/reset) 最后修改:2024 年 10 月 07 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏