Created
May 28, 2024 18:25
-
-
Save marcogrcr/d027e65f3368058e0a77a001e22f4e96 to your computer and use it in GitHub Desktop.
Print element attributes
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
((selector) => Array | |
.from(document.querySelectorAll(selector)) | |
.map(x => Array | |
.from(Array(x.attributes.length).keys()) | |
.reduce((o, i) => ({ [x.attributes.item(i).name]: x.attributes.item(i).value, ...o }), {}) | |
) | |
)('meta') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment