HTML DOM : Introduction Guide
- DOM is simple and standard way to access and manipulate HTML documents.
- DOM presents an HTML document as a tree-structure.
- DOM enables us to create documents and parts of documents, navigate through the document, move, copy, and remove parts of the document, and add or modify attributes.
- DOM is “Document Object Model”.
Let me explain this with simple example -
<p title="HTML Learning">Learning <b>HTML</b> is not a big task</p>
Above HTML code will be rendered like this in the browser -
What is DOM ?
- DOM means “Document Object Model“.
- DOM is used to access HTML and XML documents.
- DOM is W3c Standard.
- XML DOM is used to access XML document.
- HTML DOM is used to access HTML document.
- DOM defines the objects and properties of an elements, and the methods to access them.
What we can do using DOM ?
- Can Add Element to Document
- Can Remove Element from the Document
- Can Add attribute to the existing Element
- Can Modify or Delete Attribute of Element