1. Understand the DOM
DOM: Document Object Model
DOM is the standard for accessing and manipulating HTML
Core DOM: Core DOM, a standard model for any structured document
XML DOM: Standard model for XML documents
HTML DOM: Standard model for HTML documents
2. Classification of DOM nodes
1. Document Node
2. Label (element) node
3. Attribute node
4. Text Node
5. Comment Node
3. DOM node hierarchy (DOM tree)
1. Parent node (parent node): the parent node has any number of child nodes
2. Child node: A child node can only have one parent node
3. Sibling node (sibling node): a sibling node with the same parent node
4. Root node (root node): an html document generally has only one root node, the root node does not have a parent node, is the uppermost node
Ancestor nodes: Any node that contains child nodes can be called an ancestor node, including the parent node
Descendant nodes: all nodes contained in a node are called descendant nodes, including child nodes
4. JS interacts with these tags on the page
1. Get the label (element) node
Modify the label css style
Modify label properties
2. Create a label
3. Delete the label
4. Copy the label
5. Insert the label