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.