SlideShare a Scribd company logo
1 of 14
ME PRESENTATION
ON
DOCUMENT OBJECT MODEL
PREPARED BY :
UPADHYAY RAKSHITA R.
Er No : 140370707018
Roll No : 24
Contents….
2
 Introduction
 How DOM works?
 Document tree
 HTML DOM access nodes
 DOM Properties
 DOM Methods
 References
8/5/2015
Introduction
 The HTML DOM defines a standard way for accessing
and manipulating HTML documents.
 It presents an HTML document as a tree-structure with
elements, attributes, and text.
 With JavaScript you can restructure an entire HTML
document. You can add, remove, change, or reorder items
on a page.
8/5/2015
3
 This access, along with methods and properties to add,
move, change, or remove HTML elements, is given
through DOM.
 The DOM can be used by JavaScript to read and change
HTML, XHTML, and XML documents.
8/5/2015
4
5
How the DOM works?
<head><script>
function toggle()
{ document.img.button1.src=“button_on.gif”; }
</script></head>
<body>
<a href=“test.html” onmouseover=“toggle()”> <img name=“button1” src=“button_off.gif”></a>
</body>
action
reaction
Action Event JavaScript DOM Reactio
nsrc=“button_off.gif” onmouseov
er
toggle() document.img.butto
n1
Src=“button_on.gi
f”
1) User moves mouse over object
2) Event senses that something happened to the object
3) JavaScript tells the object what to do (Even handler)
4) Locates object on the web page
5) Object’s image source is changed
8/5/2015
Document Tree (Node Tree)
<html>
<head>
<title> My title </title>
</head>
<body>
<h1> My header </h1>
<a href=“http://.... > My link </a>
</body>
</html>
8/5/2015
6
Document Tree (Node Tree)
8/5/2015
7
HTML DOM Example
<html>
<head>
<script type="text/javascript">
function ChangeColor() {
document.body.bgColor="yellow" }
</script>
</head>
<body onclick="ChangeColor()">
Click on this document!
</body>
</html>
8/5/2015
8
HTML DOM Access Nodes
 The getElementById() method returns the element with
the specified ID:
document.getElementById("someID");
 The getElementsByTagName() method returns all
elements (as a nodeList) with the specified tag name.
document.getElementsByTagName("p");
8/5/2015
9
DOM Objects
 DOM Anchor DOM Area
DOM Base DOM Body
DOM Button DOM Event
DOM Form DOM Frame
DOM Frameset DOM IFrame
DOM Image DOM Input Button
DOM Input Checkbox DOM Input File
DOM Input Hidden DOM Input Password
DOM Input Radio DOM Input Reset
DOM Input Submit DOM Input Text
DOM Link DOM Meta
DOM Object DOM Option
DOM Select DOM Style
DOM Table DOM TableCell
DOM TableRow DOM Textarea
8/5/2015
10
DOM Properties
11
8/5/2015
DOM Methods
12
8/5/2015
References
13
 www.w3school.com
 www.tutorialspoint.com/javascript
8/5/2015
8/5/2015

More Related Content

What's hot

Eye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyEye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyshabab shihan
 
Document Object Model
Document Object ModelDocument Object Model
Document Object ModelMayur Mudgal
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)WebStackAcademy
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptFahim Abdullah
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)Partnered Health
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Gil Fink
 
HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryFAKHRUN NISHA
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays Reem Alattas
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypesVarun C M
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and FunctionsJussi Pohjolainen
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)Webtech Learning
 

What's hot (20)

Js ppt
Js pptJs ppt
Js ppt
 
Eye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyEye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easily
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Jquery
JqueryJquery
Jquery
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
Html coding
Html codingHtml coding
Html coding
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 
Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)
 
css.ppt
css.pptcss.ppt
css.ppt
 
GRID VIEW PPT
GRID VIEW PPTGRID VIEW PPT
GRID VIEW PPT
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/Jquery
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and Functions
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 

Similar to Dom

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 ObjectArti Parab Academics
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScriptLilia Sfaxi
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you needDipen Parmar
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsNikita Garg
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsxu fag
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsMinea Chem
 
Additional HTML
Additional HTML Additional HTML
Additional HTML Doeun KOCH
 
HTML web design_ an introduction to design
HTML web design_ an introduction to designHTML web design_ an introduction to design
HTML web design_ an introduction to designSureshSingh142
 
HTML CSS by Anubhav Singh
HTML CSS by Anubhav SinghHTML CSS by Anubhav Singh
HTML CSS by Anubhav SinghAnubhav659
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.Beqa Chacha
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02Aditya Varma
 
Document object model
Document object modelDocument object model
Document object modelAmit kumar
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handlingsmitha273566
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential TrainingKaloyan Kosev
 

Similar to Dom (20)

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
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScript
 
2.java script dom
2.java script  dom2.java script  dom
2.java script dom
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
 
Html
HtmlHtml
Html
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
Dom
DomDom
Dom
 
Additional HTML
Additional HTML Additional HTML
Additional HTML
 
HTML web design_ an introduction to design
HTML web design_ an introduction to designHTML web design_ an introduction to design
HTML web design_ an introduction to design
 
HTML CSS by Anubhav Singh
HTML CSS by Anubhav SinghHTML CSS by Anubhav Singh
HTML CSS by Anubhav Singh
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.
 
HTML guide for beginners
HTML guide for beginnersHTML guide for beginners
HTML guide for beginners
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02
 
Document object model
Document object modelDocument object model
Document object model
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handling
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
 

More from Rakshita Upadhyay

More from Rakshita Upadhyay (9)

Rs methodologyandreliability
Rs methodologyandreliabilityRs methodologyandreliability
Rs methodologyandreliability
 
Optimal control system
Optimal control systemOptimal control system
Optimal control system
 
Insulation coordination
Insulation coordinationInsulation coordination
Insulation coordination
 
Fc tcr.newpptx
Fc tcr.newpptxFc tcr.newpptx
Fc tcr.newpptx
 
load shedding
load sheddingload shedding
load shedding
 
Plc and hmi based stenter machine poster
Plc and hmi based stenter machine posterPlc and hmi based stenter machine poster
Plc and hmi based stenter machine poster
 
Plc and hmi baed stenter machine01
Plc and hmi baed stenter machine01Plc and hmi baed stenter machine01
Plc and hmi baed stenter machine01
 
Induction machine modelling
Induction machine modelling Induction machine modelling
Induction machine modelling
 
Reneable energy
Reneable energyReneable energy
Reneable energy
 

Dom

  • 1. ME PRESENTATION ON DOCUMENT OBJECT MODEL PREPARED BY : UPADHYAY RAKSHITA R. Er No : 140370707018 Roll No : 24
  • 2. Contents…. 2  Introduction  How DOM works?  Document tree  HTML DOM access nodes  DOM Properties  DOM Methods  References 8/5/2015
  • 3. Introduction  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  It presents an HTML document as a tree-structure with elements, attributes, and text.  With JavaScript you can restructure an entire HTML document. You can add, remove, change, or reorder items on a page. 8/5/2015 3
  • 4.  This access, along with methods and properties to add, move, change, or remove HTML elements, is given through DOM.  The DOM can be used by JavaScript to read and change HTML, XHTML, and XML documents. 8/5/2015 4
  • 5. 5 How the DOM works? <head><script> function toggle() { document.img.button1.src=“button_on.gif”; } </script></head> <body> <a href=“test.html” onmouseover=“toggle()”> <img name=“button1” src=“button_off.gif”></a> </body> action reaction Action Event JavaScript DOM Reactio nsrc=“button_off.gif” onmouseov er toggle() document.img.butto n1 Src=“button_on.gi f” 1) User moves mouse over object 2) Event senses that something happened to the object 3) JavaScript tells the object what to do (Even handler) 4) Locates object on the web page 5) Object’s image source is changed 8/5/2015
  • 6. Document Tree (Node Tree) <html> <head> <title> My title </title> </head> <body> <h1> My header </h1> <a href=“http://.... > My link </a> </body> </html> 8/5/2015 6
  • 7. Document Tree (Node Tree) 8/5/2015 7
  • 8. HTML DOM Example <html> <head> <script type="text/javascript"> function ChangeColor() { document.body.bgColor="yellow" } </script> </head> <body onclick="ChangeColor()"> Click on this document! </body> </html> 8/5/2015 8
  • 9. HTML DOM Access Nodes  The getElementById() method returns the element with the specified ID: document.getElementById("someID");  The getElementsByTagName() method returns all elements (as a nodeList) with the specified tag name. document.getElementsByTagName("p"); 8/5/2015 9
  • 10. DOM Objects  DOM Anchor DOM Area DOM Base DOM Body DOM Button DOM Event DOM Form DOM Frame DOM Frameset DOM IFrame DOM Image DOM Input Button DOM Input Checkbox DOM Input File DOM Input Hidden DOM Input Password DOM Input Radio DOM Input Reset DOM Input Submit DOM Input Text DOM Link DOM Meta DOM Object DOM Option DOM Select DOM Style DOM Table DOM TableCell DOM TableRow DOM Textarea 8/5/2015 10