The HTMLElement.click() method simulates a mouse click on an element.

When click() is used with supported elements (such as an <input>), it fires the element's click event. This event then bubbles up to elements higher in the document tree (or event chain) and fires their click events.

Syntax

element.click()

Specification

Specification Status Comment
Document Object Model (DOM) Level 2 HTML Specification Obsolete Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 9
Notes
Full support 9
Notes
Notes Before Chrome 19, click is only defined on buttons and inputs.
Edge Full support YesFirefox Full support 3
Notes
Full support 3
Notes
Notes Before Firefox 5, click is only defined on buttons and inputs, and has no effect on text and file inputs.
IE Full support YesOpera Full support YesSafari Full support Yes
Notes
Full support Yes
Notes
Notes Before Safari 6, click is only defined on buttons and inputs.
WebView Android Full support Yes
Notes
Full support Yes
Notes
Notes Before Android WebView 4.4, click is only defined on buttons and inputs.
Chrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 5Opera Android Full support YesSafari iOS Full support Yes
Notes
Full support Yes
Notes
Notes Before Safari 6, click is only defined on buttons and inputs.
Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.