element.click

Table of contents

  1. 1. Summary
  2. 2. Syntax
  3. 3. Notes
  4. 4. Specification
Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. Notes
  4. 4. Specification

« Gecko DOM Reference

Summary

The click method simulates a mouse click on an element.

Syntax

element.click() 

Notes

Gecko 5.0 note
(Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)

Prior to Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2) , Gecko didn't implement the click method on other elements that might be expected to respond to mouse–clicks such as links (A elements), nor will it necessarily fire the click event of other elements. However, now it is supported by all elements, as required by HTML5.

Non–Gecko DOMs may behave differently.

When a click is used with elements that support it (e.g. one of the <input> types listed above), it also fires the element's click event which will bubble up to elements higher up the document tree (or event chain) and fire their click events too. However, bubbling of a click event will not cause an A element to initiate navigation as if a real mouse-click had been received.

Specification

click

Tags (3)

Edit tags

Attachments (0)

 

Attach file