====== 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); }