HTML DOM Element click() method
- Previous Page className
- Next Page clientHeight
- Go Back to the Previous Level HTML DOM Elements Object
Definition and usage
click()
Method simulates mouse click on an element.
This method can be used to perform a click on an element, just like a user manually clicks it.
Example
Simulate clicking the mouse when the mouse pointer is moved over the checkbox:
<input type="checkbox" id="myCheck" onmouseover="myFunction()"; <script> function myFunction() { document.getElementById("myCheck").click(); } </script>
Syntax
element.click()
Parameter
None.
Return value
None.
Browser support
All browsers support element.click()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
Related Pages
HTML DOM Reference Manual:onclick Event
- Previous Page className
- Next Page clientHeight
- Go Back to the Previous Level HTML DOM Elements Object