Chapter 3. Objects and the DOM

Objects are the foundation of object-oriented programming (OOP), which is the way the logic of most modern applications and Web sites is written. As you will start to discover, everything in JavaScript is an object. For example, when you create a function or an array, you are actually creating a specialized kind of object. As its name implies, the Document Object Model (DOM) is simply, from JavaScript’s view, a large data object. When you use JavaScript to add HTML elements to your markup, you are extending this object with new properties.

If you have worked with JavaScript a little and have added some simple functionality to a page, you may find that this chapter takes your understanding to a new level. If you ...

Get Scriptin’ with JavaScript and Ajax: A Designer’s Guide 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.