CHAPTER 6Events

The most important aspect to unobtrusive DOM scripting is the use of dynamically bound events. The ultimate goal of writing usable JavaScript code is to have a web page that will work for the users, no matter what browser they're using or what platform they're on. To accomplish this, you set a goal of the features that you want to use, and exclude any browsers that do not support them. For the unsupported browsers, you then give them a functional, albeit less interactive, version of the site. The benefits to writing JavaScript and HTML interactions in this manner include cleaner code, more accessible web pages, and better user interactions. All of this is accomplished by using DOM events to improve the interaction that occurs ...

Get Pro JavaScript™ 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.