Created
September 20, 2016 17:31
-
-
Save YuriBrunetto/d06b70541b9de1911adda72ecf9952c8 to your computer and use it in GitHub Desktop.
ES6 shortcut - Get elements like jQuery
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
const $ = document.querySelector.bind(document) | |
// id | |
let divs = [ | |
$("#div"), | |
$("#input") | |
] | |
// class | |
let other = [ | |
$(".div"), | |
$(".other") | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment