get sibling element after element
var currentNode = document.querySelect("#myNode") //gets sibling element var nextSibling = currentNode.nextElementSibling; while(true){ // if no more elements break if(nextSibling == null) break; //proccess the nextNode // -------- //get the next node for the next iteration of the cycle nextSibling = nextSibling.nextElementSibling; }