what is html doms.........
Answers
Answer:
The Document Object Model is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree.
Answer:
The HTML DOM is an Object Model for HTML. It defines:
HTML elements as objects
Properties for all HTML elements
Methods for all HTML elements
Events for all HTML elements
The HTML DOM is an API (Programming Interface) for JavaScript:
JavaScript can add/change/remove HTML elements
JavaScript can add/change/remove HTML attributes
JavaScript can add/change/remove CSS styles
JavaScript can react to HTML events
JavaScript can add/change/remove HTML events
The HTML DOM (Document Object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects:
The HTML DOM Tree of Objects
DOM HTML tree
Finding HTML Elements
When you want to access HTML elements with JavaScript, you have to find the elements first.
There are a couple of ways to do this:
Finding HTML elements by id
Finding HTML elements by tag name
Finding HTML elements by class name
Finding HTML elements by CSS selectors
Finding HTML elements by HTML object collections
Finding HTML Element by Id
The easiest way to find an HTML element in the DOM, is by using the element id.
This example finds the element with id="intro":
Example
var myElement = document.getElementById("intro");
Try it Yourself »
If the element is found, the method will return the element as an object (in myElement).
If the element is not found, myElement will contain null.
Finding HTML Elements by Tag Name
Explanation:
that is your answer