We can use different types of events in our HDMI document to execute javascript code.
There are many different types of events but some common events include Mouse Clicks mouse overs mouse
out key down and document load.
Let's take a look at a basic on click event in our sample HMO file.
We have a button element that will display the time when clicked in this case.
The event is the click and the function that is triggered is the date.
Function
reviews the inner HMO statement to display the output you can see in our web browser when I click the
time button the date is displayed the date and time we can change on click on mouse over
and now the function will be triggered when I hover my mouse over the button.
I don't need to click.
If we change it to on mouse out the date will be displayed once my mouse is out of the button area.