Created
September 16, 2013 07:08
-
-
Save glebcha/6577482 to your computer and use it in GitHub Desktop.
jQuery-like vanilla.js selector
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
function $$(selector){ | |
return Array.prototype.slice.call(document.querySelectorAll(selector), 0); | |
} | |
$$('div').length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment