HTML DOM Events

The onclick Event

Use the addEventListener() method to attach a "click" event to a p element:

Click me.