Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Summary

Section 12.1 Introduction

• The Document Object Model (p. 396) gives you access to all the elements on a web page. Using JavaScript, you can dynamically create, modify and remove elements in the page.

Section 12.2 Modeling a Document: DOM Nodes and Trees

• The getElementById method returns objects called DOM nodes (p. 396). Every element in an HTML5 page is modeled in the web browser by a DOM node.

• All the nodes in a document make up the page’s DOM tree (p. 396), which describes the relationships among elements.

• Nodes are related to each other through child-parent relationships. An HTML5 element inside another element is said to be its child (p. 396)—the containing element is known as the parent (p. 396). A node can have multiple children but only one parent. Nodes with the same parent node are referred to as siblings (p. 396).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint