User Tools

Site Tools


javascript:dom:find_next_node_in_dom

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.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki