Handler (Definition)

An event handler can be attached to an HTML tag as an attribute.

The event handlers can be attached to a particular object within the HTML document or within the JavaScript. Some event handlers can only be attached with HTML tag attributes. Others only by setting the event handler property of an object to point at an event handling function.

The names of the handlers in HTML are case-insensitive, although there are some conventions.

The value associated with the event handling tag attribute is a fragment of JavaScript code. The script source text forms the body of an anonymous function object. This may simply contain a call to the name of an event handling function or it may be several lines of JavaScript code. It is probably a good idea to encapsulate the handler into a function and refer to it by name.