Event History

In the beginning (before the version 4 browsers), all event handlers lived as attributes inside HTML elements, such as onClick living inside links and buttons, and onmouseover and onmouseout living inside links. Those simple event handlers knew that something happened, but they couldn't tell you anything about where it happened.

Version 4 browsers turned events into full-fledged objects all by themselves. These objects suddenly knew a lot about the events: where on the screen they happened and which key on the keyboard was pressed down. These new event objects were fully exposed to JavaScript, so one could do a lot more with the events in version 4 browsers.

An odd concept also appeared in the version 4 browsers: event propagation. ...

Get Advanced JavaScript™: Insights and Innovative Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.