【发布时间】:2023-03-15 05:36:02
【问题描述】:
这是 HTML5 代码:
<form name="memberInfo">
<table border=1>
<tr><td>Username</td><td><input id="username" /></td></tr>
<button type = "reset" id = "resetButton">Reset</button>
<input type=button value="submit" onclick="Validate()"/>
</table>
</form>
这里是 JavaScript 代码:
window.onload =function(){
var _getForm = document.getElementById("memberInfo");
_getForm.addEventListener('reset',function(){
document.getElementById("username").focus()
})
}
【问题讨论】:
-
您的页面中有哪些表单?请出示您的 HTML 代码
-
你试过.focus()吗?
-
这只是一种形式
标签: javascript html