Jump to content

atheneor

Starter
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About atheneor

  • Rank
    Starter
  1. Hi guys, I tried to convert the following jquery code to vanilla js. It seems like I've made mistake. $(".menu-link").click(function() { $("#menu").toggleClass("active"); $(".container").toggleClass("active"); }); document.querySelectorAll(".menu-link").addEventListener("click", () => { var menu = document.querySelector("#menu"); menu.classList.toggle("active"); var container = document.querySelector(".container"); container.classList.toggle("active"); }); Thanks a lot!
×
×
  • Create New...