4.16 EVENT HANDLING

The concept of dynamic behavior can be achieved through a well-defined user event handling mechanism. Events refer to user actions like clicking of a button, mouse movement (up/down), change of values and on-load of a page. Each of these events can be recognized by JavaScript (though the browser), trigerring a callback that can be custom written in JavaScript.

The events happen in the objects within the DOM model as in the clicking of a button by a user. However, not all events are generated by users alone—the system also generates some events. Event handling has been one of the most challenging topics in JavaScript, since its implementation has changed over the years. Not surprisingly, its implementation is browser-dependent. ...

Get Web Technology: Theory and Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.