S1-18-CSI ZG526-L8.pptx - CSI ZG526 Web Technologies BITS Pilani Akshaya Ganesan Off-Campus BITS-Pilani BITS Pilani Hyderabad Campus Lecture 8

S1-18-CSI ZG526-L8.pptx - CSI ZG526 Web Technologies BITS...

This preview shows page 1 - 8 out of 36 pages.

BITS Pilani Akshaya Ganesan Off-Campus BITS-Pilani CSI ZG526 Web Technologies
Image of page 1
BITS Pilani Hyderabad Campus Lecture 8: JavaScript and DOM
Image of page 2
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956 The Document Object Model (DOM) is a interface between HTML and Javascript It represents the webpage, programs can change the document structure, style, and content. The DOM represents the document as nodes and objects. A Web page is a document. This document can be either displayed in the browser window or as the HTML source. The Document Object Model (DOM) represents that same document so it can be manipulated. The DOM is an object-oriented representation of the web page, which can be modified with a scripting language such as JavaScript. Different browsers have different implementations of the DOM, but every web browser uses some document object model to make web pages accessible via JavaScript. DOM 08/09/2018 CSI ZG526 Web Technologies 3
Image of page 3
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956 The DOM is a W3C (World Wide Web Consortium) standard. The DOM defines a standard for accessing documents: "The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document." The W3C DOM standard is separated into 3 different parts: Core DOM - standard model for all document types XML DOM - standard model for XML documents HTML DOM - standard model for HTML documents DOM 08/09/2018 CSI ZG526 Web Technologies 4
Image of page 4
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956 The HTML DOM is a standard object model and programming interface for HTML. It defines: The HTML elements as objects The properties of all HTML elements The methods to access all HTML elements The events for all HTML elements In other words: The HTML DOM is a standard for how to get, change, add, or delete HTML elements. Every element in a document—the document as a whole, the head, tables within the document, table headers, text within the table cells—is part of the document object model for that document, so they can all be accessed and manipulated using the DOM and a scripting language like JavaScript . HTML DOM 08/09/2018 CSI ZG526 Web Technologies 5
Image of page 5
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956 DOM <html> <head> <title>My title</title> </head> <body> <a href=“link”>My Link</a> <h1>My header</h1> </body> </html> 08/09/2018 CSI ZG526 Web Technologies 6
Image of page 6
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956 The document object represents your web page. To access any element in an HTML page, start with accessing the document object. Use the document object to access and manipulate HTML.
Image of page 7
Image of page 8

You've reached the end of your free preview.

Want to read all 36 pages?

  • Fall '19
  • World Wide Web, Document Object Model

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes