HTML Dom Tutorial
Introduction to the manual
The HTML DOM defines standard methods for accessing and manipulating HTML documents. DOM expresses HTML documents in a tree structure.
Know the HTML DOM
The DOM is a collection of nodes or pieces of information organized in a hierarchy. This hierarchy allows developers to navigate the tree looking for specific information. Analyzing that structure usually requires loading the entire document and constructing the hierarchy before any work can be done. Since it is based on the information hierarchy, the DOM is considered to be tree-based or object-based.
The HTML DOM defines standard methods for accessing and manipulating HTML documents.
HTML DOM renders HTML documents as a tree structure (node tree) with elements, attributes, and text.
Overview of the tutorial structure
This tutorial consists of 13 sections, describes the basic usage of HTML DOM in detail, and is accompanied by a large number of online trial-run examples to assist your learning, allowing you to easily master HTML DOM.
This tutorial contains:
10. HTML DOM Events
12. HTML DOM Summary
HTML DOM development and preparation before learning:
In 1998, the W3C published the first-level DOM specification. This specification allows access and manipulation of each individual element in an HTML page. All browsers implement this standard, so DOM compatibility issues are almost invisible.
Before you start learning HTML DOM, you should have a basic understanding of the following:
" HTML Tutorial "
" CSS Tutorial "
In this tutorial, you'll learn how to manipulate HTML more efficiently through the Document Object Model (DOM) without the help of a DOM manipulation library. The code samples in the tutorial take you through modern DOM concepts by demonstrating how various node objects work.
Advantages and Disadvantages of HTML DOM
Strong ease of use, when using DOM, all XML document information will be stored in memory, and the traversal is simple, XPath is supported, and the ease of use is enhanced.
Inefficiency, slow parsing, high memory footprint, and almost impossible to use for large files. In addition, the low efficiency is also manifested in a lot of time consumption, because when using DOM for parsing, an object will be created for each element, attribute, processing-instrUCtion and comment of the document, so that the creation of a large number of objects used in the DOM mechanism and destruction will undoubtedly affect its efficiency.
HTML DOM Reference Manual:
W3C official website: https://www.w3.org/