Document Object Model (DOM)

Official definition of DOM

  • DOM, Document Object Model, Document Object Model. We can think of all "things" in a web page as "objects".

  • DOM is a web page standard or rule set by the W3C, and this standard is implemented in the form of an "object" in the browser.

  • The official definition of DOM: DOM enables scripts, dynamic access or operations, web page content, web page appearance, and web page structure.


# Classification of DOM

  • Core DOM: Provides common properties and methods for manipulating HTML documents and XML documents at the same time.

  • HTML DOM: Special attribute method provided for HTML documents.

  • XML DOM: Special properties and methods provided for XML documents.

  • CSS DOM: Provides properties and methods for operating CSS.

  • Event DOM: Event Object Model. Such as: onclick, onload, etc.


##HTML node tree

    php.cn 
北京市 上海市 深圳市

1000.png


##Node relationship


Root node, an HTML document has only one root, which is the HTML node.
  • Subnode: the subordinate node of a certain node.
  • Parent node: the superior node of a certain node.
  • Sibling node: Two child nodes belong to the same parent node.

#Node type in DOM


The document document node represents the entire web page and does not represent any HTML tags. But it is the parent node of the html node.

  • element element node refers to any HTML tag. Each HTML tag is called an "element node". It can have text nodes and attribute nodes.

  • attribute attribute node. Refers to the attributes of HTML tags.

  • text node. Is the bottom node of the node tree.

Continuing Learning
||
php.cn
北京市 上海市 深圳市
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!