Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

GlobalEventHandlers.onsubmit

window 对象 submit 事件的事件句柄.

语法

window.onsubmit = funcRef;

参数

  • funcRef 是个函数引用

例子

<html>
<script>
function reg() {
  window.captureEvents(Event.SUBMIT);
  window.onsubmit = hit;
}
 
function hit() {
  alert('hit');
}
</script>

<body onload="reg();">
<form>
  <input type="submit" value="submit" />
</form>
<div id="d"> </div>
</body>
</html>

备注

当用户点击提交按钮(<input type="submit"/>)提交表单时,会触发submit事件.

规范

Specification Status Comment
WHATWG HTML Living Standard
onsubmit
Living Standard  

文档标签和贡献者

标签: 
 此页面的贡献者: Ende93, teoli, basemnassar11, ziyunfei
 最后编辑者: Ende93,