Created
June 26, 2023 05:26
-
-
Save Sternbach-Software/8334061216b07c78d8560acfb0c8d56f 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 unescapedInnerHTMLFromSelector(selector) { | |
return Array | |
.from( | |
document.querySelectorAll(selector) | |
) | |
.map( | |
function (node) { | |
with (document.createRange().createContextualFragment(node.outerHTML)) { | |
return textContent; | |
} | |
} | |
); | |
} | |
console.log(unescapedInnerHTMLFromSelector('div.mx-sm a')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment