.onSubmit
<HTMLElement>.onSubmit()
Attaches an event handler callback function to the “submit” event of a <form>
element.
- Usage:
- HTMLFormElement = Form.
onSubmit
(callback) - Member of:
- HTMLFormElement
- Parameters:
- callback – the function to call when the “submit” event occurs (required).
- Returns:
- The HTMLFormElement it was called on, thus allowing for command chaining.
- Note:
- This is just a shorthand function for the .on method, specific for the “submit” event. See there for more information and examples.
See also