document object model dom
play

Document Object Model (DOM) Manipulating HTML Could actually alter - PowerPoint PPT Presentation

Document Object Model (DOM) Manipulating HTML Could actually alter the HTML text and re-render Much better: programmatic model of the page Document Object Model The document object model is a now-standard way to model the HTML


  1. Document Object Model (DOM) • Manipulating HTML – Could actually alter the HTML text and re-render – Much better: programmatic model of the page • Document Object Model – The document object model is a now-standard way to model the HTML elements on the page – Works the same for XML and (X)HTML

  2. Document Object Model (DOM) • The DOM is a hierarchical model of nodes – Each node can have attributes – Each node can contain other nodes Form <form action=“self.php” method=“POST”> <input type=“text” name=“product”> action: “self.php” method: “POST” <input type=“text” name=“cost”> </form> (children) Input Input type: “text” type: “text” name: “product” name: “cost”

  3. Document Object Model (DOM) • Access from scripts – Modern web browser rendering engines reflect the DOM as scriptable objects – Any script running on the page has access to global variables • document – root of the html • window – handle to the browser window, with attributes such as size, position and the location bar

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