HTML onsubmit Event Attribute HTML Event Attributes Example Run a script when a form is submitted: Try it » Browser support All major browsers support the onsubmit event attribute Definition and Usage The onsubmit attribute is triggered when a form is submitted. The onsubmit attribute only applies to the element. Differences between HTML 4.01 and HTML5 none. Syntax HTML Event Attributes