HTML DOM (Cont.)


With JavaScript you can restructure an entire HTML document. To change anything on a page, JavaScript needs access to all elements in the HTML document. This access, along with methods and properties to add, move, change, or remove HTML elements, is given through the DOM. W3C has published the DOM specification, which allowed access to and manipulation of every single element in an HTML page. For example, assume the title of a web page is as follows:
   <head><title>HTML DOM</title></head>
The following JavaScript command will print the title “HTML DOM”:
   document.write( document.title )

Core DOM
It is a standard model for any structured document. The Core DOM is a set of objects and interfaces for accessing and manipulating document objects. The Core functionality is sufficient to allow software developers and web script authors to access and manipulate parsed HTML and XML content inside conforming products. The Core DOM API also allows creation and population of a Document object using only DOM API calls.

XML (or HTML) DOM
The XML (or HTML) DOM defines the objects and properties of all XML (or HTML) elements, and the methods (interface) to access them. In other words: The XML (or HTML) DOM is a standard for how to get, change, add, or delete XML (or HTML) elements. The XML (or HTML) DOM is
Demonstration
The following demonstration shows how the script of HTML and JavaScript is displayed on the Web.

     





      Did you hear about the kidnapping at school?    
      It’s okay. He woke up.