Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
  • Overview
  • Transcript

1.2 JavaScript Without jQuery

In this lesson, we’ll take some jQuery-enabled code and convert it to vanilla JavaScript step by step. We’ll look at several common parts of jQuery’s API, and I’ll show you how we can accomplish the same thing using the standard DOM and JavaScript ES6.

Code Snippets

For HTTP requests, we’ll use fetch:

fetch("data.json").then((response) => {
    response.json().then((obj) => {

    });
});

For selecting elements, we’ll use methods of the document object:

let doc = document;
doc.getElementById();
doc.querySelectorAll();

For manipulating an element’s CSS classes, we’ll use the classList object:

element.classList.add("my-class");