tinymce.dom.TreeWalker

TreeWalker class enables you to walk the DOM in a linear manner.

Examples

var walker = new tinymce.dom.TreeWalker(startNode);

do {
    console.log(walker.current());
} while (walker.next());

Summary

Methods

Name Summary Defined by

current()

Returns the current node.

TreeWalker

next()

Walks to the next node in tree.

TreeWalker

prev()

Walks to the previous node in tree.

TreeWalker

Methods

current()

current(): Node

Returns the current node.

Return value

  • Node - Current node where the walker is.


next()

next(): Node

Walks to the next node in tree.

Return value

  • Node - Current node where the walker is after moving to the next node.


prev()

prev(): Node

Walks to the previous node in tree.

Return value

  • Node - Current node where the walker is after moving to the previous node.