ExampleExecute a JavaScript when a form is submitted: |
Browser Support |
1. Definition and Usage
The onsubmit attribute fires when a form is submitted.
The onsubmit attribute is only used within: <form>.
2. Differences Between HTML 4.01 and HTML5
None.
3. Syntax
<element onsubmit="script">
4. Attribute Values
Value | Description |
---|---|
script | The script to be run on onsubmit |