HTML, JS: DOM
[Dom]
: is the W3C Document Object Model.
: is a W3C (World Wide Web Consortium) standard that defines a standard for accessing documents.
Core DOM | standard model for all document types |
XML DOM | standard model for XML documents |
HTML DOM | standard model for HTML documents |
: is a platform and language-neutral interface.
: allows programs and scripts to dynamically access and update the content, structure, and style of a document.
[HTML DOM]
: is a standard object model and programming interface for HTML.
: is a standard for how to get, change, add, or delete HTML elements.
: 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
: When a web page is loaded, the browser creates a Document Object Model of the page.
[JavaScript HTML DOM]
: With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
: 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 |