Object Flowchart

Throughout this book, we’ve primarily used DOM scripting, relying on looking for particular ids versus particular objects. It’s simply easier to use getElementByID() and access the element you want directly, rather than descending the object tree, as with document.form.button.radio. We recommend that you use DOM scripting in your code, as well.

If you want information about what objects are available to you, check out the Firefox DOM Inspector, shown in Figure A.1. While not everything is cross-browser, it will give you a number of places to start.

Figure A.1. With the Firefox DOM Inspector, you can see precisely how the browser sees your code.

For older browsers, however, those options aren’t available, ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition 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.