HTML onclick Event Attribute
Example
Run a script when the mouse is clicked:
Try it »
Browser support





All major browsers support the onclick event attribute
Definition and Usage
The onclick attribute is triggered when the mouse is clicked.
Note: The onclick attribute cannot be applied to the following elements:
, , ,
HTML Event Attributes