Last active
July 13, 2021 04:22
-
-
Save mevius6/fce49167a9962f1afe168404847ca9ca to your computer and use it in GitHub Desktop.
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 doc = document; | |
| const select = (expr, con) => (con || doc).querySelector(expr); | |
| const selectAll = (expr, con) => { | |
| return Array.prototype.slice.call((con || doc).querySelectorAll(expr)); | |
| } | |
| const selectFromData = (expr, con) => selectAll(`[data-${con}]`) | |
| .find(item => item.dataset[con] === expr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment