In this section, we will learn what the Element click() property is and how to use it in JavaScript.
What is Element click() Method in JavaScript?
The JavaScript Element click() method is used to invoke the click event on an element programmatically.
Basically, this method is a simulation of a mouse clicking on an element.
Element click() Method Syntax:
element.click();
Element click() Method Parameter
The method does not take an argument.
Element click() Method Return Value
The click() method does not return a value.
Example: JavaScript simulate button click
See the Pen JavaScript simulate button click by Omid Dehghan (@odchan1) on CodePen.