SlideShare a Scribd company logo
DOCUMENT AND ITS
ASSOCIATED OBJECTS
THE HTML DOM DOCUMENT OBJECT
document, Link, Area, Anchor, Image, Applet, Layer
HTML DOM NODES
 In the HTML DOM (Document Object Model), everything is a node:
 The document itself is a document node
 All HTML elements are element nodes
 All HTML attributes are attribute nodes
 Text inside HTML elements are text nodes
 Comments are comment nodes
THE HTML DOM (DOCUMENT OBJECT MODEL)
THE DOCUMENT OBJECT
 When an HTML document is loaded into a web browser, it becomes a document object.
 The document object is the root node of the HTML document and the "owner" of all
other nodes:
(element nodes, text nodes, attribute nodes, and comment nodes).
 The document object provides properties and methods to access all node objects, from
within JavaScript.
 Tip: The document is a part of the Window object and can be accessed as
window.document.
JAVASCRIPT HAS ALL THE POWER
 With the object model, JavaScript gets all the power it needs to create
dynamic HTML:
 JavaScript can change all the HTML elements in the page
 JavaScript can change all the HTML attributes in the page
 JavaScript can change all the CSS styles in the page
 JavaScript can remove existing HTML elements and attributes
 JavaScript can add new HTML elements and attributes
 JavaScript can react to all existing HTML events in the page
 JavaScript can create new HTML events in the page
WHAT IS THE HTML DOM?
 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.
JAVASCRIPT - HTML DOM METHODS
 HTML DOM methods are actions you can perform (on
HTML Elements).
 HTML DOM properties are values (of HTML Elements) that
you can set or change.
EXAMPLE
<!DOCTYPE html>
<html>
<body>
<h1>My First Page</h1>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "Hello World!";
</script>
</body>
</html>
DOM METHODS & PROPERTIES
 The getElementById Method
 The most common way to access an HTML element is to use the id of the element.
 In the example above the getElementById method used id="demo" to find the
element.
 The innerHTML Property
 The easiest way to get the content of an element is by using
the innerHTML property.
 The innerHTML property is useful for getting or replacing the content of HTML
elements.
DOMPROPERTIES
Property Description
document.anchors Returns all <a> elements that have a name attribute
document.applets Returns all <applet> elements (Deprecated in HTML5)
document.body Returns the <body> element
document.cookie Returns the document's cookie
document.doctype Returns the document's doctype
document.documentElement Returns the <html> element
document.documentMode Returns the mode used by the browser
document.documentURI Returns the URI of the document
document.domain Returns the domain name of the document server
document.domConfig Obsolete. Returns the DOM configuration
document.embeds Returns all <embed> elements
document.forms Returns all <form> elements
document.head Returns the <head> element
document.images Returns all <img> elements
document.implementation Returns the DOM implementation
document.inputEncoding Returns the document's encoding (character set)
document.lastModified Returns the date and time the document was updated
document.links Returns all <area> and <a> elements that have a href attribute
document.readyState Returns the (loading) status of the document
document.referrer Returns the URI of the referrer (the linking document)
document.scripts Returns all <script> elements
document.strictErrorChecking Returns if error checking is enforced
document.title Returns the <title> element
document.URL Returns the complete URL of the document
DOM METHODS- FINDING HTML
ELEMENTS
Method Description
document.getElementById(id) Find an element by element id
document.getElementsByTagName(na
me)
Find elements by tag name
document.getElementsByClassName(n
ame)
Find elements by class name
DOCUMENT.BODY
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
alert(“Hi”);
</script>
</body>
</html>
DOCUMENT.BODY
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
alert(document.body.innerHTML);
</script>
</body>
</html>
DOCUMENT.ANCHORS
<!DOCTYPE html>
<html>
<body>
<p>
<a href="/html/default.asp">HTML</a>
<br>
<a href="/css/default.asp">CSS</a>
</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
"Number of links: " + document.links.length;
</script>
</body>
</html>
DOCUMENT.ANCHORS
<!DOCTYPE html>
<html>
<body>
<a name="html">HTML Tutorial</a><br>
<a name="css">CSS Tutorial</a><br>
<a name="xml">XML Tutorial</a><br>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
"Number of anchors are: " + document.anchors.length;
</script>
</body>
</html>
DOCUMENT.IMAGES
<!DOCTYPE html>
<html>
<body>
<img src="pic_htmltree.gif">
<img src="pic_navigate.gif">
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
"Number of images: " + document.images.length;
</script>
</body>
</html>

More Related Content

What's hot

Html5 appunti.0
Html5   appunti.0Html5   appunti.0
Html5 appunti.0
orestJump
 
Javascript
JavascriptJavascript
Javascript
orestJump
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
borkweb
 
Javascript
JavascriptJavascript
Javascript
Rajavel Dhandabani
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
orestJump
 
DIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningDIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web Designing
Rasan Samarasinghe
 
Web designing unit 4
Web designing unit 4Web designing unit 4
Web designing unit 4
SURBHI SAROHA
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Ayes Chinmay
 
jQuery Beginner
jQuery BeginnerjQuery Beginner
jQuery Beginner
kumar gaurav
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
Dominic Arrojado
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
Stijn Van Minnebruggen
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
Anis Ahmad
 
Java script -23jan2015
Java script -23jan2015Java script -23jan2015
Java script -23jan2015
Sasidhar Kothuru
 
Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQueryShawn Calvert
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
Muhammad Afzal Qureshi
 

What's hot (20)

Html5 appunti.0
Html5   appunti.0Html5   appunti.0
Html5 appunti.0
 
Javascript
JavascriptJavascript
Javascript
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
Javascript
JavascriptJavascript
Javascript
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
 
Html tags describe in bangla
Html tags describe in banglaHtml tags describe in bangla
Html tags describe in bangla
 
DIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningDIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web Designing
 
Web designing unit 4
Web designing unit 4Web designing unit 4
Web designing unit 4
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
 
jQuery Beginner
jQuery BeginnerjQuery Beginner
jQuery Beginner
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Dom
DomDom
Dom
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
Java script -23jan2015
Java script -23jan2015Java script -23jan2015
Java script -23jan2015
 
Think jQuery
Think jQueryThink jQuery
Think jQuery
 
Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQuery
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
 

Similar to FYBSC IT Web Programming Unit III Document Object

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
 
Document object model
Document object modelDocument object model
Document object model
Amit 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 handling
smitha273566
 
Digital Marketing Company
Digital Marketing CompanyDigital Marketing Company
Digital Marketing Company
Payal9675
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
Julie Iskander
 
WEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptxWEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptx
karthiksmart21
 
Java script
Java scriptJava script
Java script
Yoga Raja
 
Javascript part 2 DOM.pptx
Javascript part 2 DOM.pptxJavascript part 2 DOM.pptx
Javascript part 2 DOM.pptx
deepa339830
 
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
 
DOM Quick Overview
DOM Quick OverviewDOM Quick Overview
DOM Quick Overview
Signure Technologies
 
2.java script dom
2.java script  dom2.java script  dom
2.java script dom
PhD Research Scholar
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScript
Lilia Sfaxi
 
Document Object Model (DOM)
Document Object Model (DOM)Document Object Model (DOM)
Document Object Model (DOM)
GOPAL BASAK
 
Web technologies-course 09.pptx
Web technologies-course 09.pptxWeb technologies-course 09.pptx
Web technologies-course 09.pptx
Stefan Oprea
 

Similar to FYBSC IT Web Programming Unit III Document Object (20)

DOM(Document Object Model) in javascript
DOM(Document Object Model) in javascriptDOM(Document Object Model) in javascript
DOM(Document Object Model) in javascript
 
Dom
DomDom
Dom
 
Dom structure
Dom structure Dom structure
Dom structure
 
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
 
Digital Marketing Company
Digital Marketing CompanyDigital Marketing Company
Digital Marketing Company
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
 
WEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptxWEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptx
 
Dom
DomDom
Dom
 
Java script
Java scriptJava script
Java script
 
Javascript part 2 DOM.pptx
Javascript part 2 DOM.pptxJavascript part 2 DOM.pptx
Javascript part 2 DOM.pptx
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
 
Automating Ievb
Automating IevbAutomating Ievb
Automating Ievb
 
DOM Quick Overview
DOM Quick OverviewDOM Quick Overview
DOM Quick Overview
 
2.java script dom
2.java script  dom2.java script  dom
2.java script dom
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScript
 
Document Object Model (DOM)
Document Object Model (DOM)Document Object Model (DOM)
Document Object Model (DOM)
 
Web technologies-course 09.pptx
Web technologies-course 09.pptxWeb technologies-course 09.pptx
Web technologies-course 09.pptx
 

More from Arti Parab Academics

COMPUTER APPLICATIONS Module 4.pptx
COMPUTER APPLICATIONS Module 4.pptxCOMPUTER APPLICATIONS Module 4.pptx
COMPUTER APPLICATIONS Module 4.pptx
Arti Parab Academics
 
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptxCOMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
Arti Parab Academics
 
COMPUTER APPLICATIONS Module 5.pptx
COMPUTER APPLICATIONS Module 5.pptxCOMPUTER APPLICATIONS Module 5.pptx
COMPUTER APPLICATIONS Module 5.pptx
Arti Parab Academics
 
COMPUTER APPLICATIONS Module 1 CAH.pptx
COMPUTER APPLICATIONS Module 1 CAH.pptxCOMPUTER APPLICATIONS Module 1 CAH.pptx
COMPUTER APPLICATIONS Module 1 CAH.pptx
Arti Parab Academics
 
COMPUTER APPLICATIONS Module 3.pptx
COMPUTER APPLICATIONS Module 3.pptxCOMPUTER APPLICATIONS Module 3.pptx
COMPUTER APPLICATIONS Module 3.pptx
Arti Parab Academics
 
COMPUTER APPLICATIONS Module 2.pptx
COMPUTER APPLICATIONS Module 2.pptxCOMPUTER APPLICATIONS Module 2.pptx
COMPUTER APPLICATIONS Module 2.pptx
Arti Parab Academics
 
Health Informatics- Module 5-Chapter 2.pptx
Health Informatics- Module 5-Chapter 2.pptxHealth Informatics- Module 5-Chapter 2.pptx
Health Informatics- Module 5-Chapter 2.pptx
Arti Parab Academics
 
Health Informatics- Module 5-Chapter 3.pptx
Health Informatics- Module 5-Chapter 3.pptxHealth Informatics- Module 5-Chapter 3.pptx
Health Informatics- Module 5-Chapter 3.pptx
Arti Parab Academics
 
Health Informatics- Module 4-Chapter 3.pptx
Health Informatics- Module 4-Chapter 3.pptxHealth Informatics- Module 4-Chapter 3.pptx
Health Informatics- Module 4-Chapter 3.pptx
Arti Parab Academics
 
Health Informatics- Module 3-Chapter 2.pptx
Health Informatics- Module 3-Chapter 2.pptxHealth Informatics- Module 3-Chapter 2.pptx
Health Informatics- Module 3-Chapter 2.pptx
Arti Parab Academics
 
Health Informatics- Module 4-Chapter 1.pptx
Health Informatics- Module 4-Chapter 1.pptxHealth Informatics- Module 4-Chapter 1.pptx
Health Informatics- Module 4-Chapter 1.pptx
Arti Parab Academics
 
Health Informatics- Module 4-Chapter 2.pptx
Health Informatics- Module 4-Chapter 2.pptxHealth Informatics- Module 4-Chapter 2.pptx
Health Informatics- Module 4-Chapter 2.pptx
Arti Parab Academics
 
Health Informatics- Module 3-Chapter 3.pptx
Health Informatics- Module 3-Chapter 3.pptxHealth Informatics- Module 3-Chapter 3.pptx
Health Informatics- Module 3-Chapter 3.pptx
Arti Parab Academics
 
Health Informatics- Module 5-Chapter 1.pptx
Health Informatics- Module 5-Chapter 1.pptxHealth Informatics- Module 5-Chapter 1.pptx
Health Informatics- Module 5-Chapter 1.pptx
Arti Parab Academics
 
Health Informatics- Module 3-Chapter 1.pptx
Health Informatics- Module 3-Chapter 1.pptxHealth Informatics- Module 3-Chapter 1.pptx
Health Informatics- Module 3-Chapter 1.pptx
Arti Parab Academics
 
Health Informatics- Module 2-Chapter 2.pptx
Health Informatics- Module 2-Chapter 2.pptxHealth Informatics- Module 2-Chapter 2.pptx
Health Informatics- Module 2-Chapter 2.pptx
Arti Parab Academics
 
Health Informatics- Module 1-Chapter 1.pptx
Health Informatics- Module 1-Chapter 1.pptxHealth Informatics- Module 1-Chapter 1.pptx
Health Informatics- Module 1-Chapter 1.pptx
Arti Parab Academics
 
Health Informatics- Module 2-Chapter 3.pptx
Health Informatics- Module 2-Chapter 3.pptxHealth Informatics- Module 2-Chapter 3.pptx
Health Informatics- Module 2-Chapter 3.pptx
Arti Parab Academics
 
Health Informatics- Module 2-Chapter 1.pptx
Health Informatics- Module 2-Chapter 1.pptxHealth Informatics- Module 2-Chapter 1.pptx
Health Informatics- Module 2-Chapter 1.pptx
Arti Parab Academics
 
Health Informatics- Module 1-Chapter 2.pptx
Health Informatics- Module 1-Chapter 2.pptxHealth Informatics- Module 1-Chapter 2.pptx
Health Informatics- Module 1-Chapter 2.pptx
Arti Parab Academics
 

More from Arti Parab Academics (20)

COMPUTER APPLICATIONS Module 4.pptx
COMPUTER APPLICATIONS Module 4.pptxCOMPUTER APPLICATIONS Module 4.pptx
COMPUTER APPLICATIONS Module 4.pptx
 
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptxCOMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
 
COMPUTER APPLICATIONS Module 5.pptx
COMPUTER APPLICATIONS Module 5.pptxCOMPUTER APPLICATIONS Module 5.pptx
COMPUTER APPLICATIONS Module 5.pptx
 
COMPUTER APPLICATIONS Module 1 CAH.pptx
COMPUTER APPLICATIONS Module 1 CAH.pptxCOMPUTER APPLICATIONS Module 1 CAH.pptx
COMPUTER APPLICATIONS Module 1 CAH.pptx
 
COMPUTER APPLICATIONS Module 3.pptx
COMPUTER APPLICATIONS Module 3.pptxCOMPUTER APPLICATIONS Module 3.pptx
COMPUTER APPLICATIONS Module 3.pptx
 
COMPUTER APPLICATIONS Module 2.pptx
COMPUTER APPLICATIONS Module 2.pptxCOMPUTER APPLICATIONS Module 2.pptx
COMPUTER APPLICATIONS Module 2.pptx
 
Health Informatics- Module 5-Chapter 2.pptx
Health Informatics- Module 5-Chapter 2.pptxHealth Informatics- Module 5-Chapter 2.pptx
Health Informatics- Module 5-Chapter 2.pptx
 
Health Informatics- Module 5-Chapter 3.pptx
Health Informatics- Module 5-Chapter 3.pptxHealth Informatics- Module 5-Chapter 3.pptx
Health Informatics- Module 5-Chapter 3.pptx
 
Health Informatics- Module 4-Chapter 3.pptx
Health Informatics- Module 4-Chapter 3.pptxHealth Informatics- Module 4-Chapter 3.pptx
Health Informatics- Module 4-Chapter 3.pptx
 
Health Informatics- Module 3-Chapter 2.pptx
Health Informatics- Module 3-Chapter 2.pptxHealth Informatics- Module 3-Chapter 2.pptx
Health Informatics- Module 3-Chapter 2.pptx
 
Health Informatics- Module 4-Chapter 1.pptx
Health Informatics- Module 4-Chapter 1.pptxHealth Informatics- Module 4-Chapter 1.pptx
Health Informatics- Module 4-Chapter 1.pptx
 
Health Informatics- Module 4-Chapter 2.pptx
Health Informatics- Module 4-Chapter 2.pptxHealth Informatics- Module 4-Chapter 2.pptx
Health Informatics- Module 4-Chapter 2.pptx
 
Health Informatics- Module 3-Chapter 3.pptx
Health Informatics- Module 3-Chapter 3.pptxHealth Informatics- Module 3-Chapter 3.pptx
Health Informatics- Module 3-Chapter 3.pptx
 
Health Informatics- Module 5-Chapter 1.pptx
Health Informatics- Module 5-Chapter 1.pptxHealth Informatics- Module 5-Chapter 1.pptx
Health Informatics- Module 5-Chapter 1.pptx
 
Health Informatics- Module 3-Chapter 1.pptx
Health Informatics- Module 3-Chapter 1.pptxHealth Informatics- Module 3-Chapter 1.pptx
Health Informatics- Module 3-Chapter 1.pptx
 
Health Informatics- Module 2-Chapter 2.pptx
Health Informatics- Module 2-Chapter 2.pptxHealth Informatics- Module 2-Chapter 2.pptx
Health Informatics- Module 2-Chapter 2.pptx
 
Health Informatics- Module 1-Chapter 1.pptx
Health Informatics- Module 1-Chapter 1.pptxHealth Informatics- Module 1-Chapter 1.pptx
Health Informatics- Module 1-Chapter 1.pptx
 
Health Informatics- Module 2-Chapter 3.pptx
Health Informatics- Module 2-Chapter 3.pptxHealth Informatics- Module 2-Chapter 3.pptx
Health Informatics- Module 2-Chapter 3.pptx
 
Health Informatics- Module 2-Chapter 1.pptx
Health Informatics- Module 2-Chapter 1.pptxHealth Informatics- Module 2-Chapter 1.pptx
Health Informatics- Module 2-Chapter 1.pptx
 
Health Informatics- Module 1-Chapter 2.pptx
Health Informatics- Module 1-Chapter 2.pptxHealth Informatics- Module 1-Chapter 2.pptx
Health Informatics- Module 1-Chapter 2.pptx
 

Recently uploaded

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

FYBSC IT Web Programming Unit III Document Object

  • 1. DOCUMENT AND ITS ASSOCIATED OBJECTS THE HTML DOM DOCUMENT OBJECT document, Link, Area, Anchor, Image, Applet, Layer
  • 2. HTML DOM NODES  In the HTML DOM (Document Object Model), everything is a node:  The document itself is a document node  All HTML elements are element nodes  All HTML attributes are attribute nodes  Text inside HTML elements are text nodes  Comments are comment nodes
  • 3. THE HTML DOM (DOCUMENT OBJECT MODEL)
  • 4. THE DOCUMENT OBJECT  When an HTML document is loaded into a web browser, it becomes a document object.  The document object is the root node of the HTML document and the "owner" of all other nodes: (element nodes, text nodes, attribute nodes, and comment nodes).  The document object provides properties and methods to access all node objects, from within JavaScript.  Tip: The document is a part of the Window object and can be accessed as window.document.
  • 5. JAVASCRIPT HAS ALL THE POWER  With the object model, JavaScript gets all the power it needs to create dynamic HTML:  JavaScript can change all the HTML elements in the page  JavaScript can change all the HTML attributes in the page  JavaScript can change all the CSS styles in the page  JavaScript can remove existing HTML elements and attributes  JavaScript can add new HTML elements and attributes  JavaScript can react to all existing HTML events in the page  JavaScript can create new HTML events in the page
  • 6. WHAT IS THE HTML DOM?  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.
  • 7. JAVASCRIPT - HTML DOM METHODS  HTML DOM methods are actions you can perform (on HTML Elements).  HTML DOM properties are values (of HTML Elements) that you can set or change.
  • 8. EXAMPLE <!DOCTYPE html> <html> <body> <h1>My First Page</h1> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "Hello World!"; </script> </body> </html>
  • 9. DOM METHODS & PROPERTIES  The getElementById Method  The most common way to access an HTML element is to use the id of the element.  In the example above the getElementById method used id="demo" to find the element.  The innerHTML Property  The easiest way to get the content of an element is by using the innerHTML property.  The innerHTML property is useful for getting or replacing the content of HTML elements.
  • 10. DOMPROPERTIES Property Description document.anchors Returns all <a> elements that have a name attribute document.applets Returns all <applet> elements (Deprecated in HTML5) document.body Returns the <body> element document.cookie Returns the document's cookie document.doctype Returns the document's doctype document.documentElement Returns the <html> element document.documentMode Returns the mode used by the browser document.documentURI Returns the URI of the document document.domain Returns the domain name of the document server document.domConfig Obsolete. Returns the DOM configuration document.embeds Returns all <embed> elements document.forms Returns all <form> elements document.head Returns the <head> element document.images Returns all <img> elements document.implementation Returns the DOM implementation document.inputEncoding Returns the document's encoding (character set) document.lastModified Returns the date and time the document was updated document.links Returns all <area> and <a> elements that have a href attribute document.readyState Returns the (loading) status of the document document.referrer Returns the URI of the referrer (the linking document) document.scripts Returns all <script> elements document.strictErrorChecking Returns if error checking is enforced document.title Returns the <title> element document.URL Returns the complete URL of the document
  • 11. DOM METHODS- FINDING HTML ELEMENTS Method Description document.getElementById(id) Find an element by element id document.getElementsByTagName(na me) Find elements by tag name document.getElementsByClassName(n ame) Find elements by class name
  • 14. DOCUMENT.ANCHORS <!DOCTYPE html> <html> <body> <p> <a href="/html/default.asp">HTML</a> <br> <a href="/css/default.asp">CSS</a> </p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "Number of links: " + document.links.length; </script> </body> </html>
  • 15. DOCUMENT.ANCHORS <!DOCTYPE html> <html> <body> <a name="html">HTML Tutorial</a><br> <a name="css">CSS Tutorial</a><br> <a name="xml">XML Tutorial</a><br> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "Number of anchors are: " + document.anchors.length; </script> </body> </html>
  • 16. DOCUMENT.IMAGES <!DOCTYPE html> <html> <body> <img src="pic_htmltree.gif"> <img src="pic_navigate.gif"> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "Number of images: " + document.images.length; </script> </body> </html>