About jQuery
Do more with less lines of code
jQuery for adding a class to every menu-link
$(".menu-link").addClass("is-open");JavaScript for adding a class to every menu-link
document.querySelectorAll(".menu-link").forEach(function(element) {
element.classList.add("is-open");
});Chainable methods
jQuery for adding a class to every video-button and setting its attribute
$(".video-button").addClass("is-paused").attr("aria-pressed", "true");JavaScript for adding a class to every video-button and setting its attribute
Less likely to cause errors
This jQuery will not throw an error if h2 is not found on the page.
This JavaScript will throw an error if h2 is not found on the page.
Switching between jQuery & JavaScript
Converting jQuery element to JavaScript
Converting JavaScript element to jQuery
How to add jQuery code in Webflow

Last updated