Difference between HTML and DOM

HtmlDom

Html Problem Overview


What is the difference between DOM and HTML?

Html Solutions


Solution 1 - Html

DOM is a model of a document with an associated API for manipulating it.

HTML is a markup language that lets you represent a certain kind of DOM in text.

Other kinds of DOMs can be expressed in other markup languages, for example RSS and Atom can be converted to a DOM and manipulated with the same API as an HTML or XHTML document (more or less anyway; there are some HTML specific DOM extensions).

Solution 2 - Html

The Document Object Model (DOM) is a language-independent model made up of objects representing the structure of a document. HTML is one language for writing such documents.

Solution 3 - Html

Well, if you look in things like firebug, you can also check out the "DOM". Then they usually mean the current state the HTML page is in. So if you, for example, have a html page and add a

tag with javascript.

The actual HTML of the page is still the same, but the "DOM" however has changed.

Notice that this isn't the right definition of DOM, but I thought this might be what you meant.

Solution 4 - Html

DOM is the tree model to represent HTML.

Solution 5 - Html

The HTML of a page is a string, and the DOM of the page is what happens when you take that string and construct an object in the object-oriented programming sense of the term "object". Creating that object is how JavaScript is able to interact with the page:

https://en.wikipedia.org/wiki/Document_Object_Model#JavaScript > When a web page is loaded, the browser creates a Document Object Model of the page, which is an object oriented representation of an HTML document, that acts as an interface between JavaScript and the document itself and allows the creation of dynamic web pages.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkobeView Question on Stackoverflow
Solution 1 - HtmlQuentinView Answer on Stackoverflow
Solution 2 - HtmlEric MickelsenView Answer on Stackoverflow
Solution 3 - HtmlTimo WillemsenView Answer on Stackoverflow
Solution 4 - HtmlAlan Haggai AlaviView Answer on Stackoverflow
Solution 5 - HtmlNathan WailesView Answer on Stackoverflow