HTML DOM
Document Object Model
 DOM is a way to represent the webpage in a structured
hierarchical way so that it will become easier for
programmers and users.
 With DOM, we can easily access and manipulate tags, IDs,
classes, Attributes, or Elements of HTML using commands
or methods provided by the Document object.
 Using DOM, the JavaScript gets access to HTML as well
as CSS of the web page and can also add behavior to the
HTML elements.
 Document Object Model is an API that represents and
interacts with HTML or XML documents.
Why DOM is required?
HTML is used to structure the web pages and
Javascript is used to add behavior to our web pages.
When an HTML file is loaded into the browser, the
javascript can not understand the HTML document
directly.
So, a corresponding document is created(DOM).
DOM is basically the representation of the same
HTML document but in a different format with
the use of objects.
Structure of DOM
The term structure model is sometimes used
to describe the tree-like representation of a
document.
 Each branch of the tree ends in a node, and
each node contains objects Event listeners can
be added to nodes and triggered on an
occurrence of a given event.
Properties of DOM
 Window Object is object of the browser which is always at
top of the hierarchy. It is like an API that is used to set and
access all the properties and methods of the browser. It is
automatically created by the browser.
 Document object: When an HTML document is loaded
into a window, it becomes a document object. The
‘document’ object has various properties that refer to other
objects which allow access to and modification of the
content of the web page.
 Form Object: It is represented by form tags.
 Link Object: It is represented by link tags.
 Anchor Object: It is represented by a href tags.
 Form Control Elements:: Form can have many control
elements such as text fields, buttons, radio buttons, checkboxes,
etc.
Methods of Document Object
• write(“string”): Writes the given string on the
document.
• getElementById(): returns the element having the
given id value.
• getElementsByName(): returns all the elements
having the given name value.
• getElementsByTagName(): returns all the elements
having the given tag name.
• getElementsByClassName(): returns all the elements
having the given class name.
Levels of DOM
• Level 0: Provides a low-level set of interfaces.
• Level 1: DOM level 1 can be described in two
parts: CORE and HTML.
– CORE provides low-level interfaces that can be
used to represent any structured document.
– HTML provides high-level interfaces that can be
used to represent HTML documents.
• Level 2:
Six specifications: CORE2, VIEWS, EVENTS, STYLE, TRAVERSAL
and RANGE.
– CORE2: extends the functionality of CORE specified by DOM level 1.
– VIEWS: views allows programs to dynamically access and manipulate the
content of the document.
– EVENTS: Events are scripts that are either executed by the browser when
the user reacts to the web page.
– STYLE: allows programs to dynamically access and manipulate the content
of style sheets.
– TRAVERSAL: This allows programs to dynamically traverse the
document.
– RANGE: This allows programs to dynamically identify a range of content
in the document.
• Level 3:
Five different specifications: CORE3, LOAD and
SAVE, VALIDATION, EVENTS, and XPATH.
– CORE3: extends the functionality of CORE specified by DOM level 2.
– LOAD and SAVE: This allows the program to dynamically load the
content of the XML document into the DOM document and save the
DOM Document into an XML document by serialization.
– VALIDATION: This allows the program to dynamically update the
content and structure of the document while ensuring the document
remains valid.
– EVENTS: extends the functionality of Events specified by DOM Level 2.
– XPATH: XPATH is a path language that can be used to access the DOM
tree.

More Related Content

PPTX
WEB TECHNOLOGY Unit-4.pptx
PPT
Document Object Model
PPT
Document Object Model
PPTX
Document Object Model (DOM)
PPTX
Document Object Model
PDF
In the DOM, no one will hear you scream
PPTX
Document object model
PPTX
Digital Marketing Company
WEB TECHNOLOGY Unit-4.pptx
Document Object Model
Document Object Model
Document Object Model (DOM)
Document Object Model
In the DOM, no one will hear you scream
Document object model
Digital Marketing Company

Similar to Electronics is a scientific and engineering discipline that studies and applies the DOM.pptx (20)

PPT
DOMhjuuihjinmkjiiuhuygfrtdxsezwasgfddggh
PPTX
Internet and Web Technology (CLASS-5) [HTML DOM]
PDF
Understanding Dom
PPTX
Understanding the dom by Benedict Ayiko
PPTX
Web technologies-course 09.pptx
PPTX
12. session 12 java script objects
PPTX
Dom date and objects and event handling
DOCX
DOM(Document Object Model) in javascript
PPT
Document_Object_Model_in_javaScript..................................ppt
PPTX
Basic web security model
PPTX
FYBSC IT Web Programming Unit III Document Object
PDF
JavaScript - Chapter 12 - Document Object Model
PDF
DOM Enlightenment Exploring JavaScript and the Modern DOM 1st Edition Lindley...
PDF
Getting Started with DOM
PPTX
Part 7
PPT
fit100-16-dom.ppt
PPTX
WEB PROGRAMMING
DOMhjuuihjinmkjiiuhuygfrtdxsezwasgfddggh
Internet and Web Technology (CLASS-5) [HTML DOM]
Understanding Dom
Understanding the dom by Benedict Ayiko
Web technologies-course 09.pptx
12. session 12 java script objects
Dom date and objects and event handling
DOM(Document Object Model) in javascript
Document_Object_Model_in_javaScript..................................ppt
Basic web security model
FYBSC IT Web Programming Unit III Document Object
JavaScript - Chapter 12 - Document Object Model
DOM Enlightenment Exploring JavaScript and the Modern DOM 1st Edition Lindley...
Getting Started with DOM
Part 7
fit100-16-dom.ppt
WEB PROGRAMMING
Ad

Recently uploaded (20)

PPTX
SC Robotics Team Safety Training Presentation
PPTX
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
PPTX
Design ,Art Across Digital Realities and eXtended Reality
PDF
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
PPTX
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
PDF
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
PDF
Mechanics of materials week 2 rajeshwari
PPTX
DATA STRCUTURE LABORATORY -BCSL305(PRG1)
PPTX
SE unit 1.pptx by d.y.p.akurdi aaaaaaaaaaaa
PPTX
Real Estate Management PART 1.pptxFFFFFFFFFFFFF
PDF
IAE-V2500 Engine Airbus Family A319/320
PDF
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
PPTX
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PDF
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
PDF
Module 1 part 1.pdf engineering notes s7
DOCX
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
PPT
Programmable Logic Controller PLC and Industrial Automation
PDF
VTU IOT LAB MANUAL (BCS701) Computer science and Engineering
PPT
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
SC Robotics Team Safety Training Presentation
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
Design ,Art Across Digital Realities and eXtended Reality
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
Mechanics of materials week 2 rajeshwari
DATA STRCUTURE LABORATORY -BCSL305(PRG1)
SE unit 1.pptx by d.y.p.akurdi aaaaaaaaaaaa
Real Estate Management PART 1.pptxFFFFFFFFFFFFF
IAE-V2500 Engine Airbus Family A319/320
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
Module 1 part 1.pdf engineering notes s7
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
Programmable Logic Controller PLC and Industrial Automation
VTU IOT LAB MANUAL (BCS701) Computer science and Engineering
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
Ad

Electronics is a scientific and engineering discipline that studies and applies the DOM.pptx

  • 2. Document Object Model  DOM is a way to represent the webpage in a structured hierarchical way so that it will become easier for programmers and users.  With DOM, we can easily access and manipulate tags, IDs, classes, Attributes, or Elements of HTML using commands or methods provided by the Document object.  Using DOM, the JavaScript gets access to HTML as well as CSS of the web page and can also add behavior to the HTML elements.  Document Object Model is an API that represents and interacts with HTML or XML documents.
  • 3. Why DOM is required? HTML is used to structure the web pages and Javascript is used to add behavior to our web pages. When an HTML file is loaded into the browser, the javascript can not understand the HTML document directly. So, a corresponding document is created(DOM). DOM is basically the representation of the same HTML document but in a different format with the use of objects.
  • 4. Structure of DOM The term structure model is sometimes used to describe the tree-like representation of a document.  Each branch of the tree ends in a node, and each node contains objects Event listeners can be added to nodes and triggered on an occurrence of a given event.
  • 6.  Window Object is object of the browser which is always at top of the hierarchy. It is like an API that is used to set and access all the properties and methods of the browser. It is automatically created by the browser.  Document object: When an HTML document is loaded into a window, it becomes a document object. The ‘document’ object has various properties that refer to other objects which allow access to and modification of the content of the web page.  Form Object: It is represented by form tags.  Link Object: It is represented by link tags.  Anchor Object: It is represented by a href tags.  Form Control Elements:: Form can have many control elements such as text fields, buttons, radio buttons, checkboxes, etc.
  • 7. Methods of Document Object • write(“string”): Writes the given string on the document. • getElementById(): returns the element having the given id value. • getElementsByName(): returns all the elements having the given name value. • getElementsByTagName(): returns all the elements having the given tag name. • getElementsByClassName(): returns all the elements having the given class name.
  • 8. Levels of DOM • Level 0: Provides a low-level set of interfaces. • Level 1: DOM level 1 can be described in two parts: CORE and HTML. – CORE provides low-level interfaces that can be used to represent any structured document. – HTML provides high-level interfaces that can be used to represent HTML documents.
  • 9. • Level 2: Six specifications: CORE2, VIEWS, EVENTS, STYLE, TRAVERSAL and RANGE. – CORE2: extends the functionality of CORE specified by DOM level 1. – VIEWS: views allows programs to dynamically access and manipulate the content of the document. – EVENTS: Events are scripts that are either executed by the browser when the user reacts to the web page. – STYLE: allows programs to dynamically access and manipulate the content of style sheets. – TRAVERSAL: This allows programs to dynamically traverse the document. – RANGE: This allows programs to dynamically identify a range of content in the document.
  • 10. • Level 3: Five different specifications: CORE3, LOAD and SAVE, VALIDATION, EVENTS, and XPATH. – CORE3: extends the functionality of CORE specified by DOM level 2. – LOAD and SAVE: This allows the program to dynamically load the content of the XML document into the DOM document and save the DOM Document into an XML document by serialization. – VALIDATION: This allows the program to dynamically update the content and structure of the document while ensuring the document remains valid. – EVENTS: extends the functionality of Events specified by DOM Level 2. – XPATH: XPATH is a path language that can be used to access the DOM tree.