The onclick Event

The onclick event is used to trigger a function when an element is clicked on.

Click the button to trigger a function that will output what day it is today and what time it is.