SlideShare a Scribd company logo
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
DOM STRUCTURE
Jaseena A P
jsnp65@gmail.com
www.facebook.com/Jaseena
Muhammed A P
twitter.com/username
in.linkedin.com/in/profilena
me
9539443588
WHAT IS DOM?
 The DOM is a W3C (World Wide Web Consortium) standard.
 "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 DOM defines the objects and properties of all document
elements, and the methods (interface) to access them.
DOM
The DOM is separated into 3 different parts / levels:
Core DOM - standard model for any structured
document
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML
documents
The DOM is accessible only when the whole document has
been loaded.That’s the reason the DOM access code is
executed only after the load event has been fired.
HTML DOM
 The HTML DOM defines a standard way for accessing
and manipulating HTML documents.
 The HTML DOM is platform and language
independent and can be used by any programming
language like Java, JavaScript, and VBScript.
Features of DOM
A standard object model for HTML
A standard programming interface for HTML
Platform- and language-independent
A W3C standard.
The HTML DOM is a standard for how to get,
change, add, or delete HTML elements.
The HTML DOM defines the objects and properties
of all HTML elements, and the methods (interface)
to access them.
DOM NODES
According to the DOM, everything in an HTML document
is a node.
The entire document is a document node
Every HTML tag is an element node
The text in the HTML elements are text
nodes
Every HTML attribute is an attribute node
Comments are comment nodes
HTML DOM Node Tree (Document Tree)
All the nodes in a node tree have relationships to
each other.
The tree structure is called a node-tree.
HTML DOM Node Tree (Document Tree)
In a node tree, the top node is called the root
Every node, except the root, has exactly one
parent node
A node can have any number of children
A leaf is a node with no children
Siblings are nodes with the same parent
AN EXAMPLE
<html>
<head>
<title>DOM</title>
</head>
<body>
<h1>I am in DOM world</h1>
<p id=“intro”>Hello DOM!</p>
</body>
</html>
 The <html> node has no parent node; the root node
 The parent node of the <head> and <body> nodes is
the <html> node
 The parent node of the "Hello world!" text node is the
<p> node
DOM EXAMPLE
 Most element nodes have child nodes:
 The <html> node has two child nodes; <head> and
<body>
 The <head> node has one child node; the <title> node
 The <title> node also has one child node; the text node
"DOM “
 The <h1> and <p> nodes are siblings, and both child
nodes of <body>
HTML DOM-ACCESS NODES
We can access a node in three ways:
1. By using the getElementById() method
2. By using the getElementsByTagName()
method
3. By navigating the node tree( using the node
relationships ).
The getElementById() Method
getElementById();
method returns the element with the specified ID
Syntax
node.getElementById("someID");
The getElementByTagName() Method
getElementsByTagName();
returns all elements with a specified tag name.
Syntax
node.getElementsByTagName("tagname");
Example
<html>
<body>
<p id="intro">W3Schools example</p>
<div id="main">
<p id="main1">The DOM is very useful</p>
<p id="main2">This example demonstrates how to use
the <b>getElementsByTagName</b> method</p>
</div>
<script type="text/javascript">
x=document.getElementById("main").getElementsByTag
Name("p");
document.write("First paragraph inside the main div: " +
x[0].childNodes[0].nodeValue);
</script>
</body>
</html>
Navigating Node Relationships
The three properties parentNode, firstChild, and lastChild
follow the document structure and allow short-distance travel
in the document.
<html>
<body>
<p id="intro">W3Schools example</p>
<div id="main">
<p id="main1">The DOM is very useful</p>
<p id="main2">This example demonstrates <b>node
Relationships</b>
</p>
</div>
</body>
</html>
Navigating Node Relationships
 The <p id="intro"> is the first child node (firstChild) of
the <body> element, and the <div> element is the last
child node (lastChild) of the <body> element.
 Furthermore, the <body> is the parent (parentNode) .
 The firstChild property can be used to access the text of
an element.
x=document.getElementById(“main");
var text=x.firstChild.firstChild.nodeValue;
DOM Advantages & Disadvantages
ADVANTAGES
-Robust API for the DOM tree
-Relatively simple to modify the data structure and extract
data
Disadvantages
-Stores the entire document in memory
-As Dom was written for any language, method naming
conventions don’t follow standard java programming
conventions
THANK YOU
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

More Related Content

What's hot

JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
jQuery
jQueryjQuery
Html presentation
Html presentationHtml presentation
Html presentation
Amber Bhaumik
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Ravinder Kamboj
 
Learn html Basics
Learn html BasicsLearn html Basics
Learn html Basics
McSoftsis
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Gil Fink
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
sentayehu
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tags
Kainat Ilyas
 
Dom
Dom Dom
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
Walid Ashraf
 
Jquery
JqueryJquery
Xml parsers
Xml parsersXml parsers
Xml parsers
Manav Prasad
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
NexThoughts Technologies
 
Css selectors
Css selectorsCss selectors
Css selectors
Parth Trivedi
 
Javascript
JavascriptJavascript
Javascript
Manav Prasad
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
Edureka!
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
BG Java EE Course
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
Mayur Mudgal
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Andres Baravalle
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
 

What's hot (20)

JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
jQuery
jQueryjQuery
jQuery
 
Html presentation
Html presentationHtml presentation
Html presentation
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Learn html Basics
Learn html BasicsLearn html Basics
Learn html Basics
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tags
 
Dom
Dom Dom
Dom
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Jquery
JqueryJquery
Jquery
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Css selectors
Css selectorsCss selectors
Css selectors
 
Javascript
JavascriptJavascript
Javascript
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 

Similar to Document Object Model

Dom structure
Dom structure Dom structure
DOM Quick Overview
DOM Quick OverviewDOM Quick Overview
DOM Quick Overview
Signure Technologies
 
Document object model
Document object modelDocument object model
Document object model
Amit kumar
 
FYBSC IT Web Programming Unit III Document Object
FYBSC IT Web Programming Unit III  Document ObjectFYBSC IT Web Programming Unit III  Document Object
FYBSC IT Web Programming Unit III Document Object
Arti Parab Academics
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
HTML/CSS Lecture 1
HTML/CSS Lecture 1HTML/CSS Lecture 1
HTML/CSS Lecture 1
Lee Lundrigan
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
Damalie Wasukira
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)
Coder Tech
 
DOM(Document Object Model) in javascript
DOM(Document Object Model) in javascriptDOM(Document Object Model) in javascript
DOM(Document Object Model) in javascript
Rashmi Mishra
 
Automating Ievb
Automating IevbAutomating Ievb
Automating Ievb
nageshreddy15
 
Week 2-intro-html
Week 2-intro-htmlWeek 2-intro-html
Week 2-intro-html
Shawn Calvert
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
eceklu
 
Dom structure
Dom structureDom structure
Introduction to the DOM
Introduction to the DOMIntroduction to the DOM
Introduction to the DOM
tharaa abu ashour
 
Advance HTML
Advance HTMLAdvance HTML
Advance HTML
VijaySingh790398
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
VaibhavSingh887876
 
6867389.ppt
6867389.ppt6867389.ppt
6867389.ppt
SunilChaluvaiah
 
6867389.ppt
6867389.ppt6867389.ppt
6867389.ppt
SunilChaluvaiah
 
6867389 (1).ppt
6867389 (1).ppt6867389 (1).ppt
6867389 (1).ppt
SunilChaluvaiah
 
Xml
XmlXml

Similar to Document Object Model (20)

Dom structure
Dom structure Dom structure
Dom structure
 
DOM Quick Overview
DOM Quick OverviewDOM Quick Overview
DOM Quick Overview
 
Document object model
Document object modelDocument object model
Document object model
 
FYBSC IT Web Programming Unit III Document Object
FYBSC IT Web Programming Unit III  Document ObjectFYBSC IT Web Programming Unit III  Document Object
FYBSC IT Web Programming Unit III Document Object
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
HTML/CSS Lecture 1
HTML/CSS Lecture 1HTML/CSS Lecture 1
HTML/CSS Lecture 1
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
 
HTML (Basic to Advance)
HTML (Basic to Advance)HTML (Basic to Advance)
HTML (Basic to Advance)
 
DOM(Document Object Model) in javascript
DOM(Document Object Model) in javascriptDOM(Document Object Model) in javascript
DOM(Document Object Model) in javascript
 
Automating Ievb
Automating IevbAutomating Ievb
Automating Ievb
 
Week 2-intro-html
Week 2-intro-htmlWeek 2-intro-html
Week 2-intro-html
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Dom structure
Dom structureDom structure
Dom structure
 
Introduction to the DOM
Introduction to the DOMIntroduction to the DOM
Introduction to the DOM
 
Advance HTML
Advance HTMLAdvance HTML
Advance HTML
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
 
6867389.ppt
6867389.ppt6867389.ppt
6867389.ppt
 
6867389.ppt
6867389.ppt6867389.ppt
6867389.ppt
 
6867389 (1).ppt
6867389 (1).ppt6867389 (1).ppt
6867389 (1).ppt
 
Xml
XmlXml
Xml
 

More from baabtra.com - No. 1 supplier of quality freshers

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
baabtra.com - No. 1 supplier of quality freshers
 
Best coding practices
Best coding practicesBest coding practices
Core java - baabtra
Core java - baabtraCore java - baabtra
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
baabtra.com - No. 1 supplier of quality freshers
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
baabtra.com - No. 1 supplier of quality freshers
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
baabtra.com - No. 1 supplier of quality freshers
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php database connectivity
Php database connectivityPhp database connectivity
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Blue brain
Blue brainBlue brain
5g
5g5g
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Gd baabtra
Gd baabtraGd baabtra

More from baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Recently uploaded

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

Document Object Model

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3.
  • 4. DOM STRUCTURE Jaseena A P jsnp65@gmail.com www.facebook.com/Jaseena Muhammed A P twitter.com/username in.linkedin.com/in/profilena me 9539443588
  • 5. WHAT IS DOM?  The DOM is a W3C (World Wide Web Consortium) standard.  "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 DOM defines the objects and properties of all document elements, and the methods (interface) to access them.
  • 6. DOM The DOM is separated into 3 different parts / levels: Core DOM - standard model for any structured document XML DOM - standard model for XML documents HTML DOM - standard model for HTML documents The DOM is accessible only when the whole document has been loaded.That’s the reason the DOM access code is executed only after the load event has been fired.
  • 7. HTML DOM  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The HTML DOM is platform and language independent and can be used by any programming language like Java, JavaScript, and VBScript.
  • 8. Features of DOM A standard object model for HTML A standard programming interface for HTML Platform- and language-independent A W3C standard. The HTML DOM is a standard for how to get, change, add, or delete HTML elements. The HTML DOM defines the objects and properties of all HTML elements, and the methods (interface) to access them.
  • 9. DOM NODES According to the DOM, everything in an HTML document is a node. The entire document is a document node Every HTML tag is an element node The text in the HTML elements are text nodes Every HTML attribute is an attribute node Comments are comment nodes
  • 10. HTML DOM Node Tree (Document Tree) All the nodes in a node tree have relationships to each other. The tree structure is called a node-tree.
  • 11. HTML DOM Node Tree (Document Tree) In a node tree, the top node is called the root Every node, except the root, has exactly one parent node A node can have any number of children A leaf is a node with no children Siblings are nodes with the same parent
  • 12. AN EXAMPLE <html> <head> <title>DOM</title> </head> <body> <h1>I am in DOM world</h1> <p id=“intro”>Hello DOM!</p> </body> </html>  The <html> node has no parent node; the root node  The parent node of the <head> and <body> nodes is the <html> node  The parent node of the "Hello world!" text node is the <p> node
  • 13. DOM EXAMPLE  Most element nodes have child nodes:  The <html> node has two child nodes; <head> and <body>  The <head> node has one child node; the <title> node  The <title> node also has one child node; the text node "DOM “  The <h1> and <p> nodes are siblings, and both child nodes of <body>
  • 14. HTML DOM-ACCESS NODES We can access a node in three ways: 1. By using the getElementById() method 2. By using the getElementsByTagName() method 3. By navigating the node tree( using the node relationships ).
  • 15. The getElementById() Method getElementById(); method returns the element with the specified ID Syntax node.getElementById("someID"); The getElementByTagName() Method getElementsByTagName(); returns all elements with a specified tag name. Syntax node.getElementsByTagName("tagname");
  • 16. Example <html> <body> <p id="intro">W3Schools example</p> <div id="main"> <p id="main1">The DOM is very useful</p> <p id="main2">This example demonstrates how to use the <b>getElementsByTagName</b> method</p> </div> <script type="text/javascript"> x=document.getElementById("main").getElementsByTag Name("p"); document.write("First paragraph inside the main div: " + x[0].childNodes[0].nodeValue); </script> </body> </html>
  • 17. Navigating Node Relationships The three properties parentNode, firstChild, and lastChild follow the document structure and allow short-distance travel in the document. <html> <body> <p id="intro">W3Schools example</p> <div id="main"> <p id="main1">The DOM is very useful</p> <p id="main2">This example demonstrates <b>node Relationships</b> </p> </div> </body> </html>
  • 18. Navigating Node Relationships  The <p id="intro"> is the first child node (firstChild) of the <body> element, and the <div> element is the last child node (lastChild) of the <body> element.  Furthermore, the <body> is the parent (parentNode) .  The firstChild property can be used to access the text of an element. x=document.getElementById(“main"); var text=x.firstChild.firstChild.nodeValue;
  • 19. DOM Advantages & Disadvantages ADVANTAGES -Robust API for the DOM tree -Relatively simple to modify the data structure and extract data Disadvantages -Stores the entire document in memory -As Dom was written for any language, method naming conventions don’t follow standard java programming conventions
  • 21. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 22. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com