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.
element.click()
Specification | Status | Comment |
---|---|---|
Document Object Model (DOM) Level 2 HTML Specification | Obsolete | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 9
|
Yes | 3
|
Yes | Yes | Yes
|
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes
|
Yes | Yes | 5 | Yes | Yes
|
? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click