jQuery vs vanilla JavaScript – Beau teaches JavaScript




When should you use jQuery instead of vanilla JavaScript? Is jQuery still relevant? What is jQuery good for? Find out in this video!


Video based on this article by Ollie Williams: https://css-tricks.com/now-ever-might-not-need-jquery/

The only polyfill you’ll ever need: https://polyfill.io

🐦 Beau Carnes on Twitter: https://twitter.com/carnesbeau

⭐JavaScript Tutorials Playlists⭐
▶jQuery Playlist: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkyK9woUZUtunToLtNGoQHB

▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5


Learn to code for free and get a developer job: https://www.freecodecamp.com

Read hundreds of articles on technology: https://medium.freecodecamp.com

And subscribe for new programming videos every day: https://youtube.com/subscription_center?add_user=freecodecamp

Original source


15 responses to “jQuery vs vanilla JavaScript – Beau teaches JavaScript”

  1. Yes, but when you prepend (for example, it applies to more JS selectors) you still have to define the 'otherElem' with document.querySelector, which is longer than jQuery. So every time you try to prepend or append you might end up with greater amount of code using vanilla JS, just because of selectors.

    Doesn't matter for small apps, but if you have a big site, and thousands of the variable selectors they it's more optimal to use jquery, from code volume perspective, no? In this case at least, unless vanilla JS has jQuery beat in some other aspects.

    P.S.: So basically JavaScript chose to assimilate jQuery into itself? Based on that video I assume more and more functions will become standardized into the vanilla JS.

    P.P.S.: Great video! Thanks 🙂

  2. I have a problem with the requestAnimationFrame() thing. I have an element with a class of '.other-div' and I set the original state to the same state as you did in the CSs (opacity and display and gave it a transition property). I have a button on the button and I am trying to make the element fade in using this method and it is not working. Can anyone help please?
    const output = document.querySelector('.output');
    const otherDiv = document.querySelector('.other-div');
    const btn = document.querySelector('#button');

    btn.onclick = () => {
    otherDiv.style.display = 'block';
    requestAnimationFrame = ( () => otherDiv.style.opacity = 1);
    };

    Or here is the pen so far: https://codepen.io/Balmora/pen/XaNroE

Leave a Reply