Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
  }
 
PREVIOUS NEXT
Tagged: #sibling #element #element
ADD COMMENT
Topic
Name
3+6 =