Home > Web Front-end > HTML Tutorial > What does DOM mean?

What does DOM mean?

清浅
Release: 2021-04-15 11:23:41
Original
395024 people have browsed it

The full English name of DOM is DocumentObjectModel, which represents the document object model. It is a standard programming interface recommended by the W3C organization for processing extensible markup languages; DOM is an in-memory object representation of an HTML document, which provides the use of JavaScript and The way web pages interact.

What does DOM mean?

#The operating environment of this article: Windows 7 system, Dell G3 computer, HTML5 version.

DOM is the file object model. The page is reconstructed through JavaScript code to enhance the interactivity with the page.

This article will share an introduction to the meaning of DOM, which has certain reference value. ,I hope to be helpful.

What does DOM mean?

The meaning of DOM:

DOM is called the Document Object Model (DOM for short), which is the processing recommended by the W3C organization The standard programming interface for extensible markup language

DOM is an in-memory object representation of an HTML document, which provides a way to interact with web pages using JavaScript. The DOM is a hierarchy (or tree) of nodes with the document node as the root.

In fact, DOM is a document model described in an object-oriented way. The DOM defines the objects required to represent and modify a document, the behaviors and properties of these objects, and the relationships between these objects.

Through JavaScript, we can reconstruct the entire HTML document. Such as adding, removing, changing or rearranging items on the page.

To change something on the page, JavaScript needs to gain access to all elements in the HTML document. This entry, along with the methods and properties for adding, moving, changing, or removing HTML elements, is obtained through the Document Object Model (DOM)

Example :

The easiest way to get the content of an element in JavaScript is to get it through the innerHTML attribute, so in the following cases we can get the text content of the element through innerHTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="demo">Hello World!</p>
<script>
var demo=document.getElementById("demo").innerHTML;
document.write(demo);
</script>
</body>
</html>
Copy after login

Effect Picture:


What does DOM mean?Summary: The above is the entire content of this article. I hope it will be helpful for everyone to learn DOM attributes.

[Recommended courses:

HTML Tutorial, JavaScript Tutorial

The above is the detailed content of What does DOM mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
dom
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template