Skip to content

XML DOM: Accessing Nodes

How to access XML nodes in the DOM using JavaScript methods like getElementsByTagName(), tree traversal, and node relationships.

You can access every node in an XML document using the DOM.

Accessing Nodes

You can access a node in three ways:

  1. By using the getElementsByTagName() JavaScript method. See Accessing Nodes with getElementsByTagName() chapter.
  2. By looping through (or traversing) the nodes tree. See Node Traverse chapter.
  3. By navigating the node tree, using the node relationships. See Node Navigation chapter.
Navigation