HTML 事件属性onsubmit本页总览onsubmitHTML onsubmit 事件属性当提交表单时运行脚本:<form action="demo_form.html" onsubmit="checkForm()">尝试一下 »定义和用法onsubmit 属性在表单提交时触发。onsubmit 属性只适用于 <form> 元素。HTML 4.01 与 HTML5 之间的差异无。语法<form onsubmit="*script*">属性值值描述script规定该 onsubmit 事件触发时执行的脚本。浏览器兼容性ChromeEdgeFirefoxOperaSafariChrome AndroidFirefox for AndroidOpera AndroidSafari on iOSSamsung InternetWebView Androidsubmit eventFull supportChrome1Toggle historyFull supportEdge12Toggle historyFull supportFirefox1Toggle historyFull supportOpera8Toggle historyFull supportSafari3Toggle historyFull supportChrome Android18Toggle historyFull supportFirefox for Android4Toggle historyFull supportOpera Android10.1Toggle historyFull supportSafari on iOS1Toggle historyFull supportSamsung Internet1.0Toggle historyFull supportWebView Android4.4Toggle history