3 ms·
function $(id) { return document.getElementById(id); } Nice! Now I don't need jQuery.
by JTbane 8y ago
function $(id) { return document.getElementById(id); }
Nice! Now I don't need jQuery.
- spiralx 8y agoHere's the smallest jQuery replacement I've seen :) https://gist.github.com/paulirish/12fb951a8b893a454b32 https://gist.github.com/paulirish/12fb951a8b893a454b32 It let's you do $('p').on('click', el => /* ... */) which is handy for smaller scripts :)