Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  function $(id) { return document.getElementById(id); }
Nice! Now I don't need jQuery.


Here's the smallest jQuery replacement I've seen :)

https://gist.github.com/paulirish/12fb951a8b893a454b32

It let's you do

    $('p').on('click', el => /* ... */)
which is handy for smaller scripts :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: