DOM - Traversal

About

traversal operations on the DOM.

Example

Native

Jquery

Functions List:

$('selector')
    .parent()
    .parents() // Many
    .children()
    .find()
    .siblings()
  
* Log the text of each element
<p>Text from first p</p>
<p>Text from second p</p>
$('body > p').each( function(){
    console.log($(this).text()); 
})





Discover More
Domtree
DOM - (Node) Tree

The DOM presents an (XML|HTML) document as a tree-structure. A DOM has a standard tree structure, where each node contains one of the components from an XML structure. Generally, the vast majority of...



Share this page:
Follow us:
Task Runner