Last active
October 10, 2018 12:32
-
-
Save wking-io/4aa0e683ba01493d2a2cdf6bac064045 to your computer and use it in GitHub Desktop.
How do I get all the siblings of an element?
This file contains 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
const getSibs = (el) => Array | |
.from(el.parentNode.childNodes) | |
.filter(child => child.nodeType == 1 && child != el); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment