Last active
November 28, 2016 08:57
-
-
Save pa5aribu/8b523ded5bde60083e2d1e11fc664c95 to your computer and use it in GitHub Desktop.
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
| function getSiblings(el){ | |
| var siblings = [], | |
| sibling = el.parentNode.firstChild; | |
| for( ; sibling; sibling = sibling.nextSibling ) { | |
| if(sibling.nodeType === 1 && sibling != el){ | |
| siblings.push(sibling); | |
| } | |
| } | |
| return siblings; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment