Example 1 - the onclick event.

The strong tag has an onclick attribute to handle the click event.

The attribute value is the JavaScript that will be executed when the text is clicked

In this example. it executes an alert() function.

This is an event example. If you CLICK HERE, you will see a message.

(Note: The pointer doesn't change to a hand because the text is not a link.)


The code for the paragraph is:

     <p>This is an event example.  
     If you <strong onclick="alert('Hi');">CLICK HERE</strong>, you will see a message.</p>