Questa traduzione è incompleta. Aiutaci a tradurre questo articolo dall’inglese

Il metodo simula il click del mouse sull'elemento.

Quando viene usato click() sugli elementi che lo supportano (come un elemento <input>), esso scatena l'evento click dell'elemento stesso. Questo evento quindi si ripercuote sugli elementi padre (o sulla catena di eventi) e scatena i loro eventi click.



Specifica Stato Commento
Document Object Model (DOM) Level 2 HTML Specification Obsolete Initial definition.

Compatibilità Browser

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 20[3] (Yes) 5[1] (Yes) (Yes)[2] 6[3]
input@file (limited) (Yes) (Yes) 4 (Yes) 12.10 (Yes)
input@file (full) (Yes) (Yes) 4 (Yes) No support (Yes)
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support No support ? (Yes) ? ? ? ?

[1] Prior to Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), Gecko would not implement the click() method on other elements that might be expected to respond to mouse clicks, such as links (<a> elements), nor would it necessarily fire the click event of other elements.

[2] In Presto-based versions of Opera, the click() method will be silently ignored if made on an <input> with its type attribute set to file and its CSS display property set to none.

[3] Older versions had and only.