Created
August 12, 2017 18:02
-
-
Save bplaat/99c7b1855a5f5a287a5d7a49c53e2940 to your computer and use it in GitHub Desktop.
Simple jQuery like js dom selector
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
| const $ = (query) => Array.from(document.querySelectorAll(query)); | |
| $('button').forEach(btn => console.log(btn.innerHTML)); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A nice jquery like js dom selector that is easy to use!