黑色星期五
& 聖誕節優惠
進階方案
額外加贈 60%
50GB + 免費 30GB
獲得額外流量
靜態住宅代理最高可享
7 折
50-99 個 IP 享 7 折
選購優惠 IP
無限流量
75 折
帶寬與端口套餐
立即使用無限流量
錢包儲值
最高 $1,400
獎勵金
立即儲值

DOM Tree

DOM Tree

A DOM tree is a hierarchical representation of an HTML or XML document created by the browser.

Each part of the document becomes a node in the tree, including elements, text, and attributes. This structure allows JavaScript and other tools to access, inspect, and modify webpage content dynamically.

Also known as: Document tree, DOM structure.

How Does a DOM Tree Work?

When a browser loads a webpage, it parses the document and converts its structure into a tree of connected nodes.

For example:

<html>
  <body>
    <div>
      <p>Hello</p>
    </div>
  </body>
</html>

The resulting structure can be viewed conceptually as:

Document
└── html
    └── body
        └── div
            └── p
                └── "Hello"

Each node has a position in the hierarchy and may contain child nodes or be connected to a parent node.

This tree structure makes it possible for scripts to navigate from one element to another and update the document while the page is running.

Join SwiftProxy Discord community Chat with SwiftProxy support via WhatsApp Chat with SwiftProxy support via Telegram
Chat with SwiftProxy support via Email