EventsEach of the things that happen in a web page are Events.
Functions and EventsInline Events
The simplest way to run a function when an event fires is called inline event registration.
Assign an event handler.
<a href="page.html" onmouseover="alert('this is a link');">A link</a>
You can even use the inline technique to call a previously created function, like this:
Traditional ModelAssign (inside the head) an event handler to a page element.
If you have a function and call it usually it looks like:
When you have parenthesis you are telling it to run immediatly
If you remove the parenthesis you are letting the onload handler know what to do when the time comes.
window.onload=message; // the message loads after the page is finished loading