Browser event support started way back in second generation browsers when the individual browsers of the time began exposing certain events to JavaScript through their respective object models.
This was the real turning point for the interactive Web and laid the foundations for the event-driven web applications that proliferate on the Internet and the language of JavaScript as it stands at the present time. As I mentioned earlier in the chapter, the event model is very closely related to the Document Object Model and events are made possible by the DOM.
Early events such as onclick, onmouseover
, and onmouseout
allowed developers to add event-handling code that reacted to user-initiated actions do not respond predictably in all circumstances.
Like different event models, different browsers deal with the event
object in different ways. The event
object contains information about the most recent event that has occurred, so if a visitor clicks a link for example...