Created
February 28, 2020 08:55
-
-
Save iankit3/74340996bf6e1eef8bde5b02d901a968 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
(function(){ | |
var r = document.getRootNode(); | |
var stack = [], list = []; | |
stack.push(r); | |
while(stack.length > 0){ | |
var top = stack.pop(); | |
if(top.childNodes.length > 0){ | |
Array.from(top.childNodes) | |
.filter(e => e.nodeType == Node.ELEMENT_NODE) | |
.forEach(e => { | |
stack.push(e); | |
}); | |
} | |
if(top.classList && top.classList.contains("hoverable")){ | |
list.push(top); | |
} | |
} | |
console.log(list) | |
}()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment