HTML DOM Events

The onclick Event

The onclick event triggers a function when an element is clicked on.

Click to trigger a function that will output "Hello World":




My First JavaScript




Click on this text!