有时在HTML页面form的input里按了回车键会提交该表单,并且form的submit按钮的click事件也会被触发.这是什么原理呢?...that form element.
form的第一个submit按钮作为default button
If the user agent supports letting the user submit...浏览器隐式提交时要触发default button的click事件.在某些平台上,text field获得焦点时,按回车键会触发隐式提交
If the form has no Submit Button...Search, URL, Telephone, E-mail, Password, Local Date and Time, Date, Month, Week, Time, Number
form里有超过一个的...input时,必须阻止隐式提交
在早期的HTML规范中,还有如下描述
When there is only one single-line text input field in a form, the