Last active
May 6, 2023 03:48
-
-
Save puiutucutu/6a5fdea8b38803c2225c to your computer and use it in GitHub Desktop.
Javascript querySelectorAll for data-attributes
This file contains hidden or 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.querySelectorAll('[data-js]') | |
// will get you all elements with this attribute. | |
document.querySelectorAll('[data-js="someFooElement"]') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment