The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Vanilla JS or jQuery for click events? Reply To: Vanilla JS or jQuery for click events?


Depends on what you’re doing.

I don’t necessarily think adding a click event on something in native JS is THAT verbose personally. It’s certainly just as easy to maintain since the only variable is the element or tag you want to add an event to.

Generally speaking, I make the decision based on the needs of each project. If something’s going to have a ton of animations, etc., I’ll leverage jQuery since I’m no expert at that sort of thing.

If it’s something that just adds an event listener on click to all <a> tags to help out analytics with stuff, I’ll go native.

There are a ton of sites popping up recently that help out with the transition for the basic stuff that most people use jQuery for.