Taking a look at jQuery for the first time yesterday, it looks amazing. I’ve been fiddling with some easy jQuery tutorials back and forth, and some questions come to mind.
Can JavaScript achieve something jQuery can’t? Can JavaScript achieve something in a simpler, faster way than jQuery? Or is it so that jQuery is simply just overall better?
So the basic question here is: Is JavaScript ever ‘better’ to use than jQuery?
JQuery is a javascript library, so there is nothing you can do with jQuery that you cannot with javascript.
JQuert provides an API that is:
But: since it’s a wrapper, you might in some cases have a better performance using native APIs.
However, don’t be fooled: unless you stumble upon a very specific case where performance is a key point, the time you will spare by using jQuery API will often let you more time to write cleaner, more robust, more efficient code, and in the end compensate the microscopic overhead of jQuery in a lot of cases.