Created
July 6, 2017 17:55
-
-
Save byron-perez/25beec7a0597d981a19451c07dbe2b42 to your computer and use it in GitHub Desktop.
ejercicio06072017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nextNode = function(node) { | |
//...Code goes here to walk to the next node... | |
if(node.childNodes.length != 0) | |
{ | |
return node.firstChild; | |
} | |
else if(node.childNodes.length == 0 && node.nextSibling != null) | |
{ | |
return node.nextSibling; | |
} | |
else if(node.nextSibling == null) | |
{ | |
while(node.parentNode.nextSibling == null) | |
{ | |
node = node.parentNode; | |
} | |
return node.parentNode.nextSibling; | |
} | |
else | |
{ | |
return node; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment