HTML event onclick
Event Attribute onClick
- The user presses the mousebutton while hovering above the element, and then releases it while hovering above the element.
- The element is focused and the Return key is pressed
In this example, the user will receive a messagebox saying "You clicked on the text", after clicking anywhere on the text "Click me"
<a onClick="alert('You clicked on the text')">Click me</a>