Created
March 6, 2020 13:49
-
-
Save tolyod/8b588bd15cedc0ff3afd308c5b03f73a to your computer and use it in GitHub Desktop.
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
[...document.querySelector("#root-id").querySelectorAll('*')] // get root node and all childs | |
.reduce((acc, node) => [...acc, ...node.className.split(' ')],[]) // accomulate classNames | |
.filter((v, i, self) => self.indexOf(v) === i); // filter uniq classNames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment