4 ms·
I'm new to web-dev. Having read the vast majority of comments it seems some people think jQuery is unnecessary/obsolete. Others say it's API is better, more co
by account-5 4y ago
I'm new to web-dev.
Having read the vast majority of comments it seems some people think jQuery is unnecessary/obsolete. Others say it's API is better, more concise, more flexible, etc.
As a newbie I decided to learn vanilla JS as I was too confused with the state of the various frameworks; I mean what one would you choose to start with?
That said I'm interested in what jQuery can do that vanilla JS can't.
- jenscow 4y ago> That said I'm interested in what jQuery can do that vanilla JS can't. jQuery is written in JS, so jQuery can't do what JS can't. The main reason for using jQuery, as you say, is a cleaner API for DOM manipulation... $(".something").parent().append($("<button />").text("click me").click(fn)); If you know nothing about jQuery, you can guess what that does. Of course, you can do it in vanilla JS too. However it's a little harder to write and (more importantly) read.
- deleted 4y ago[deleted]
- dbrueck 4y agoTry Svelte, it's amazing! I never consciously made a decision to stop using jQuery, but after moving to frameworks like Svelte, there's just not a need for it most of the time (it's been years since I last added jQuery to a project, and I think that was only because I was using some third party lib that depended on it). YMMV of course.
- hu3 4y agojQuery is very comfortable and succinct for some DOM manipulation here and there. That is, when you need to sprinkle HTML with a bit of JavaScript. But if you're starting today and want to have it easy in your career, learn React or Vue. They pay better and they look good in your CV. And I say that as someone who likes jQuery. If you want to bet on something new, I suggest https://kit.svelte.dev https://kit.svelte.dev or https://www.solidjs.com https://www.solidjs.com