SlideShare una empresa de Scribd logo
1 de 24
By: Daniel Bragais
   DHTML simply means dynamic
    HTML.



Dynamic = changes each time it is
  viewed, constantly changing. Like a
  flowing river. 
   It is not a language, in the
    sense HTML is a
    Language that creates
    Web pages or that
    JavaScript create codes
    that add interactivity to
    HTML documents.
   Instead, DHTML is a collection
    of technologies that supports
    HTML and extends the
    interactive capabilities of
    browsers.
   Remember that HTML is a Static
    and is mainly a language for
    Structuring and presenting Web
    page content. Web pages only
    acquire interactivity when
    JavaScript codes are introduced,
    for example
•    Some of the most
    commonly used
    technologies include

   JavaScript
    CSS
   Document Object Model(DOM)
   XHTML.
   Therefore, DHTML does the
    following:

   Works with JavaScript
   Works with Data Object Model
    (DOM)
   Works with CSS
   Combines HTML with JavaScript
Document Object Model
       Provides a
way to TREAT individual
       elements in

      HTML
       as objects.
   You can also think of DOM as a map
    of your HTML document, with each
    element acting as a marker. Once that
    marker is set into place, it becomes
    easy for JavaScript to work on this
    marker, communicate with it, and get
    feedback from it.
HTML DOM Tree
   Since HTML provides structures for
    element in your Webpage. DOM also
    recognizes the structure of an HTML
    document. As HTML elements may
    be placed within other elements,
    DOM reads the HTML structure as a
    map. It sees the map as composed of
    sections, and within each section are
    subsections and their elements.
How to Set Up a Document Object
Consider each element in your HTML as
  an Object. DOM reads each HTML
  element as a unique object and as a
  node within your structure. However,
  to set an element as a document you
  must give it its unique identity by
  using ID attribute. This can be done
  This Ways:
   IDs are mainly used in HTML for
    layout purposes and to identify the
    unique elements in your HTML code.
    Because it is a unique identifier, each
    ID can be used only once in the page
    in defining specific elements.

                 id
    Specifies a unique id for the element.
    Naming rules: Must contain at least
    one character

    Must not contain any space characters

    In HTML, all values are case-
    insensitive
Syntax

<element   id="id">
   Definition and Usage
   The getElementById() method
    accesses the first element with the
    specified id.



   Syntax
   document.getElementById("id")
   javascript document.getelementbyid
   If you want to quickly access the
    value of an HTML input give it
    an id to make your life a lot easier.
    This small script below will check to
    see if there is any text in the text field
    "myText". The argument
    that getElementById requires is
    the id of the HTML element you wish
    to utilize.
   JavaScript Code:

   <script type="text/javascript"> function
    notEmpty(){ var myTextField =
    document.getElementById('myText');
    if(myTextField.value != "") alert("You
    entered: " + myTextField.value) else
    alert("Would you please enter some text?") }
    </script> <input type='text' id='myText' />
    <input type='button' onclick='notEmpty()'
    value='Form Checker' />
   document.getElementById returned a
    reference to our HTML
    element myText. We stored this
    reference into a variable, myTextField,
    and then used the valueproperty that
    all input elements have to use to grab
    the value the user enters.
   There are other ways to accomplish
    what the above script does, but this is
    definitely a straight-forward and
    browser-compatible approach.
Thank
         you!!!
       dan_brgs87@yahoo.com

www.codecademy.com/groups/danlike
 dojo/invite/7e343de793e7752aabb734
             dc624eb319

Más contenido relacionado

La actualidad más candente

Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and Functions
Jussi Pohjolainen
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
yht4ever
 

La actualidad más candente (20)

Html
HtmlHtml
Html
 
Xml
XmlXml
Xml
 
Html forms
Html formsHtml forms
Html forms
 
Introduction to the DOM
Introduction to the DOMIntroduction to the DOM
Introduction to the DOM
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and Functions
 
Dom
Dom Dom
Dom
 
Jquery
JqueryJquery
Jquery
 
Javascript
JavascriptJavascript
Javascript
 
Javascript
JavascriptJavascript
Javascript
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
 
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
 
Json
JsonJson
Json
 
Object Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptObject Oriented Programming In JavaScript
Object Oriented Programming In JavaScript
 
Java script
Java scriptJava script
Java script
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 

Destacado (11)

Html.ppt
Html.pptHtml.ppt
Html.ppt
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Dhtml
DhtmlDhtml
Dhtml
 
Document object model(dom)
Document object model(dom)Document object model(dom)
Document object model(dom)
 
DOM ( Document Object Model )
DOM ( Document Object Model )DOM ( Document Object Model )
DOM ( Document Object Model )
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
html5.ppt
html5.ppthtml5.ppt
html5.ppt
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 

Similar a Introduction to DOM

Similar a Introduction to DOM (20)

Digital Marketing Company
Digital Marketing CompanyDigital Marketing Company
Digital Marketing Company
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2
 
Html & Html5 from scratch
Html & Html5 from scratchHtml & Html5 from scratch
Html & Html5 from scratch
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
 
Html tutorials-infotech aus
Html tutorials-infotech ausHtml tutorials-infotech aus
Html tutorials-infotech aus
 
Presentation
PresentationPresentation
Presentation
 
Web Design & Development - Session 2
Web Design & Development - Session 2Web Design & Development - Session 2
Web Design & Development - Session 2
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 
Introduction to Web Development.pptx
Introduction to Web Development.pptxIntroduction to Web Development.pptx
Introduction to Web Development.pptx
 
Dom
DomDom
Dom
 
Computer fundamentals-internet p2
Computer fundamentals-internet p2Computer fundamentals-internet p2
Computer fundamentals-internet p2
 
Html Guide
Html GuideHtml Guide
Html Guide
 
Html
HtmlHtml
Html
 
19ESKIT058_5thSem.pptx
19ESKIT058_5thSem.pptx19ESKIT058_5thSem.pptx
19ESKIT058_5thSem.pptx
 
Introduction to Html5, css, Javascript and Jquery
Introduction to Html5, css, Javascript and JqueryIntroduction to Html5, css, Javascript and Jquery
Introduction to Html5, css, Javascript and Jquery
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5 - Tutorial
Html5 - TutorialHtml5 - Tutorial
Html5 - Tutorial
 
CreatingWebPages-Part1.ppt
CreatingWebPages-Part1.pptCreatingWebPages-Part1.ppt
CreatingWebPages-Part1.ppt
 
Html
HtmlHtml
Html
 

Más de Daniel Bragais

New teachers orientation
New teachers orientationNew teachers orientation
New teachers orientation
Daniel Bragais
 
Strategic intervention materials (1) edited
Strategic intervention materials (1) editedStrategic intervention materials (1) edited
Strategic intervention materials (1) edited
Daniel Bragais
 
Report in educational leadership
Report in educational leadershipReport in educational leadership
Report in educational leadership
Daniel Bragais
 

Más de Daniel Bragais (20)

Deped certificate
Deped certificateDeped certificate
Deped certificate
 
Mock Calls for call center practice
Mock Calls for call center practiceMock Calls for call center practice
Mock Calls for call center practice
 
Reviewer Let professional education 13
Reviewer Let professional education 13Reviewer Let professional education 13
Reviewer Let professional education 13
 
Reviewer LET professional education 12
Reviewer LET professional education 12Reviewer LET professional education 12
Reviewer LET professional education 12
 
Program for investiture 2016 tagalog version
Program for investiture 2016 tagalog versionProgram for investiture 2016 tagalog version
Program for investiture 2016 tagalog version
 
English Examination Philippines
English Examination PhilippinesEnglish Examination Philippines
English Examination Philippines
 
Program for investiture tagalog version Script and Spiel
Program for investiture tagalog version Script and SpielProgram for investiture tagalog version Script and Spiel
Program for investiture tagalog version Script and Spiel
 
Multiple intelligence - Howard Gardner
Multiple intelligence - Howard GardnerMultiple intelligence - Howard Gardner
Multiple intelligence - Howard Gardner
 
English 7 monthly test
English 7  monthly testEnglish 7  monthly test
English 7 monthly test
 
Benefits of marijuana cannabis to chemotherapy (thesis)
Benefits of marijuana cannabis to chemotherapy (thesis)Benefits of marijuana cannabis to chemotherapy (thesis)
Benefits of marijuana cannabis to chemotherapy (thesis)
 
Search warrant
Search warrantSearch warrant
Search warrant
 
Republic act 9262 anti vawc act
Republic act 9262 anti vawc actRepublic act 9262 anti vawc act
Republic act 9262 anti vawc act
 
Casa Boy Scout of the Philippines investiture 2014
Casa Boy Scout of the Philippines investiture 2014Casa Boy Scout of the Philippines investiture 2014
Casa Boy Scout of the Philippines investiture 2014
 
Modules Linear Algebra Drills
Modules Linear Algebra DrillsModules Linear Algebra Drills
Modules Linear Algebra Drills
 
What is good governance
What is good governanceWhat is good governance
What is good governance
 
Deped K12
Deped K12Deped K12
Deped K12
 
New teachers orientation
New teachers orientationNew teachers orientation
New teachers orientation
 
Ra no.7722
Ra no.7722Ra no.7722
Ra no.7722
 
Strategic intervention materials (1) edited
Strategic intervention materials (1) editedStrategic intervention materials (1) edited
Strategic intervention materials (1) edited
 
Report in educational leadership
Report in educational leadershipReport in educational leadership
Report in educational leadership
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Introduction to DOM

  • 2. DHTML simply means dynamic HTML. Dynamic = changes each time it is viewed, constantly changing. Like a flowing river. 
  • 3. It is not a language, in the sense HTML is a Language that creates Web pages or that JavaScript create codes that add interactivity to HTML documents.
  • 4. Instead, DHTML is a collection of technologies that supports HTML and extends the interactive capabilities of browsers.
  • 5. Remember that HTML is a Static and is mainly a language for Structuring and presenting Web page content. Web pages only acquire interactivity when JavaScript codes are introduced, for example
  • 6. Some of the most commonly used technologies include  JavaScript  CSS  Document Object Model(DOM)  XHTML.
  • 7. Therefore, DHTML does the following:  Works with JavaScript  Works with Data Object Model (DOM)  Works with CSS  Combines HTML with JavaScript
  • 8. Document Object Model Provides a way to TREAT individual elements in HTML as objects.
  • 9. You can also think of DOM as a map of your HTML document, with each element acting as a marker. Once that marker is set into place, it becomes easy for JavaScript to work on this marker, communicate with it, and get feedback from it.
  • 11. Since HTML provides structures for element in your Webpage. DOM also recognizes the structure of an HTML document. As HTML elements may be placed within other elements, DOM reads the HTML structure as a map. It sees the map as composed of sections, and within each section are subsections and their elements.
  • 12. How to Set Up a Document Object
  • 13. Consider each element in your HTML as an Object. DOM reads each HTML element as a unique object and as a node within your structure. However, to set an element as a document you must give it its unique identity by using ID attribute. This can be done This Ways:
  • 14. IDs are mainly used in HTML for layout purposes and to identify the unique elements in your HTML code. Because it is a unique identifier, each ID can be used only once in the page in defining specific elements.
  • 15. id Specifies a unique id for the element. Naming rules: Must contain at least one character  Must not contain any space characters  In HTML, all values are case- insensitive
  • 17. Definition and Usage  The getElementById() method accesses the first element with the specified id.  Syntax  document.getElementById("id")
  • 18. javascript document.getelementbyid  If you want to quickly access the value of an HTML input give it an id to make your life a lot easier. This small script below will check to see if there is any text in the text field "myText". The argument that getElementById requires is the id of the HTML element you wish to utilize.
  • 19. JavaScript Code:  <script type="text/javascript"> function notEmpty(){ var myTextField = document.getElementById('myText'); if(myTextField.value != "") alert("You entered: " + myTextField.value) else alert("Would you please enter some text?") } </script> <input type='text' id='myText' /> <input type='button' onclick='notEmpty()' value='Form Checker' />
  • 20.
  • 21.
  • 22.
  • 23. document.getElementById returned a reference to our HTML element myText. We stored this reference into a variable, myTextField, and then used the valueproperty that all input elements have to use to grab the value the user enters.  There are other ways to accomplish what the above script does, but this is definitely a straight-forward and browser-compatible approach.
  • 24. Thank you!!! dan_brgs87@yahoo.com www.codecademy.com/groups/danlike dojo/invite/7e343de793e7752aabb734 dc624eb319