So, the main Event Handlers are onclick, onmouseover, onmouseout, onkeydown, onload and onunload.
onload, runs code when the page is loaded, so anything you want to happen as soon as the page is seen by the user.
onmouseover, runs code when the user moves their mouse pointer over and element on the screen, so making an image larger when they are about to click on it, changing the colour of a word when the user moves their pointer over it, etc.
onclick, runs code when the user clicks on an element, so for example anything on the screen can be made into a link, or adding up prices to give a total when the user click subtotal on a shopping screen,etc.
on mouseout, runs code only when the user moves their pointer off an element on the screen, so changing the element back to it’s original format after onmouseover has changed it.
I’ll leave you to work out what onkeydown does (this programming thing is easy really isn’t it).
A really interesting one is onunload, which is run when you move away from a page or close it, used for “Are you sure?” type messages.
This basic concept is the ground work for all computer program, and is the core of computer decision making, breaking larger problems down into small if then statements, even typing on a page, if the user hits the q key, then display a letter q.
There are some modifications to this, for example the else statement, so again in a game, if the user tries to shoot, if they have bullets left, then let them shoot and reduce their number of bullets, else make a clicking noise to let them know they’re out of bullets. But while this saves time, it is just a variation on a theme (for example, in the above the same effect could be reached by an if statement saying if bullets equals zero, then play clicking noise). But the core of every program is the basic if then decision process.