Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML onsubmit Event Attribute

HTML onsubmit Event Attribute

HTML Event Attributes HTML Event Attributes

Example

Run a script when a form is submitted:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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