4 ms·
I still like to bind $ to querySelector and $$ to querySelectorAll: $ = document.querySelector .bind(document); $$ = document.querySelectorAll.bind(
by FreeHugs 7y ago
I still like to bind $ to querySelector and $$ to querySelectorAll:
$ = document.querySelector .bind(document);
$$ = document.querySelectorAll.bind(document);
- paulirish 7y agoEveryone's got their little snippet but here's my 15-liner that gives you $() and .on() syntax: $('p').on('click', el => /* ... */) https://gist.github.com/paulirish/12fb951a8b893a454b32 https://gist.github.com/paulirish/12fb951a8b893a454b32