Forum Moderators: open
Please review this complete list of built-in Javascript Events [w3schools.com]. Each of these is a trigger to which you can attach a "listener"; in other words, it's the "when" to which you may attach a "what".
For example, if I want something to happen when the user loads a page, do this:
window.onload = function(){
alert('you just loaded a page!');
}
Technically speaking, the event is "load", and the listener to that event is "onload". Listeners always start with "on".
You aren't limited to the built-in events; you can define your own, or use a script library to add useful events like domready [docs.mootools.net].