document object model introduction to web design
play

Document Object Model Introduction to Web Design Hocument html , - PowerPoint PPT Presentation

Document Object Model Introduction to Web Design Hocument html , head . titl, e ft exc r-; ext !t ext I ' ! text ! text l 1cxt Document Object Model Introduction to Web Design When a browser loads a web page, it creates a


  1. Document Object Model Introduction to Web Design Hocument html , ·head . titl, e ft exc r-; ext !t ext I ' ! text ! text l 1cxt

  2. Document Object Model Introduction to Web Design When a browser loads a web page, it creates a model of that Document Object Model page. This is called a “DOM tree” and it is stored in the browser’s memory. Every element, attribute, and piece of text in the HTML is represented by its own “DOM node.”

  3. Document Object Model Introduction to Web Design There are four main types of nodes. Types of DOM Nodes • The Document node, which represents the entire page • Element nodes, which represent individual HTML tags • Attribute nodes, which represent attributes of HTML tags, such as a class • Text nodes, which represents the text within an element, such as the content of a <p> tag We talk about the relationship between element nodes as “parents,” “children,” and “siblings.”

  4. Document Object Model Introduction to Web Design <html> <head> <title>New York University</title> </head> <body> <h1>Intro to Web Design</h1> <p>In this course you will learn how to build websites.</p> <p>Class notes are available 
 <a href="notes.html">here</a>.<p> </body> </html>

  5. Document Object Model Introduction to Web Design html head title New York University body h1 Intro to Web Design p In this lecture-based course ... p a Class notes are available here Adapted from Eloquent JavaScript: The Document Object Model

  6. Document Object Model Introduction to Web Design , --- head html ..... title - - ..... New York University ,,,,.. .. --- body --- h1 - - ...._ Intro to Web Design -- ... - p - This course . . . ,,,,. ,,,,. --- p --- Class notes are ... ,.,,. ,,,,. - a ...._ here ,,,,. ,,,,. ... - --- • Adapted from Eloquent JavaScript: The Document Object Model

  7. Document Object Model Introduction to Web Design JavaScript methods that find elements in the DOM tree are DOM Queries called “DOM queries.” DOM queries may return one element, or they may return a “node list.” Which DOM query you use depends on what you want to do and the scope of browser support required.

  8. Document Object Model Introduction to Web Design Methods that return a single element node: DOM Queries • getElementById() • querySelector()

  9. Document Object Model Introduction to Web Design Methods that return one or more elements as a node list: DOM Queries • getElementsByClassName() • getElementsByTagName() • querySelectorAll()

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend