The following discussions assume you have a basic knowledge of events and scripting. If not, please refer to the relevant sections.
We must associate an event handler to a specific element or object in order for the handler to be called when the event occurs on the element or object. We can associate an event handler by using any of the following, essentially equivalent, methods.