Last active
January 1, 2020 23:30
-
-
Save fitsum/85408d59afc9f82a0df87a3722675ce6 to your computer and use it in GitHub Desktop.
jstip from Lea Verou for capturing lists of DOM stuff using Set
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
list of classes | |
[...new Set($$("[class]").flatMap(e => [...e.classList]))] | |
list of elements | |
[...new Set($$("*").map(e => e.nodeName.toLowerCase()))] | |
Use * * * for elements inside <head> and <body> or body * for elements inside <body> only | |
from https://twitter.com/LeaVerou/status/1191059865223016448 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment