The HTMLFormElement.submit() method submits the form. This method does something similar to activating a submit button of the form.

When invoking this method directly, no submit event is raised (in particular, the form's onsubmit event handler is not run),  and constraint validation is not triggered either.

If a form control (such as a submit button) has a name or id of submit it will mask the form's submit method.

Syntax

HTMLFormElement.submit()

Example

document.forms["myform"].submit()

Specification

HTML Living standard: The form element

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

Document Tags and Contributors

Last updated by: connorshea,