jQuery vs Javascript




What’s the difference between jQuery and Javascript? Let’s break it down.

Original source


23 responses to “jQuery vs Javascript”

  1. is there an advantage to using javascript instead of jquery? should I learn both? just one of them? i don't get it. It just seems like jquery is way simpler but jquery says it uses javascript language so i don't understand that.

  2. Personally I do love using jQuery but I will have to say that he didn’t use the same logic/algorithm to just adding class if you follow my example you can see this could be done with pure js with two lines of code.
    //js
    var element = document.getElementById("myDIV");
    element.classList.add("mystyle");
    //jquery
    $("#myDIV").addClass("mystyle");

  3. When we begin to learn a new language and arrive at functions, the first thing we learn about them is that functions are there so that we don't have to retype the same code again and again everytime we want to use the sequence of code. So thank you, captain Obvious, for stating that jQuery is exactly that.

  4. Wow, THANK YOU for presenting this so clearly. I was sporadically using jQuery without really understanding what any of the code meant (just copy / pasting code I would find to achieve what I needed to do, asking more experienced designers for help etc.). I knew I needed to step my game up from just html, css, and bootstrap so for the past 2 months have been teaching myself JavaScript. Long story short, recently someone tried to explain to me that what I have been learning (JavaScript) is "un-simplified" jQuery. I had no idea lol! But when they tried to explain how the two languages are tied together I was left confused. This really cleared up the basic correlation for me!

  5. I really like the way you present your information but I think your example is a little flawed. The same result could be achieved with just javascript with this one line:

    document.querySelector(".goodbye").classList.add("selected");

    while the jQuery is shorter. It's not as drastic. I'm not sure if you were using that long-form example to emphasize your point more but I just wanted to point that out.

Leave a Reply