Book Image

Practical Web Development

By : Paul Wellens
Book Image

Practical Web Development

By: Paul Wellens

Overview of this book

Table of Contents (23 chapters)
Practical Web Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
10
XML and JSON
Index

The Document Object Model (DOM)


As we learned in the previous chapter, an HTML document consists of a tree structure of nested tags, with HTML as the root. In programming, the contents of that tree can be stored in a large object and subtrees can be accessed, modified, or added by using smaller objects.

The whole lot is referred to as the Document Object Model (DOM). In subsequent chapters, we will learn a programming language (JavaScript) to do exactly that and a JavaScript library (jQuery) to make it easier. In this chapter, we will not be learning how to change our content, but we will learn how to change the style of our content. In all cases, we need a way to access our document. This is where selectors fit in.