Jquery being 14 years old is still used by half of websites. The concept of Jquery is a great idea that is to simplify JS DOM manipulation, simplify AJAX and to make it easier to support IE. Now that AJAX is no longer needed as we can use the fetch API, and there is less of a need to support old IE browsers, there is no longer a real need for Jquery. But if I am writing vanilla JS I dont want to write document.querySelector every single time.
var $ = document.querySelector
var $$ = document.querySelectorAll
Use these function shortcuts and it will make life much easier.
Top comments (3)
Actually, some browsers already inject this into the global scope if there is no library or code that is setting
$
or$$
.interesting
I like this.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.