javascript:dom:find_next_node_in_dom

This is an old revision of the document!


JavaScript - DOM - Find next node in dom

function next(node, skip) {
  if (node == null) {
    return null;
  }
  if (!skip && node.firstChild) {
    return node.firstChild;
  }
  if (node.nextSibling) {
    return node.nextSibling;
  }
  return next(node.parentNode, true);
}
javascript/dom/find_next_node_in_dom.1589973878.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki