My goal was to create this function using Flask, but it seems that only JavaScript is capable of achieving it. This is my first attempt at coding it. Here's the code snippet:
const navSlide2 = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelectorAll('.test');
burger.addEventListener('click',()=>{
nav.classList.toggle('heading-nav-active');
});
}
I aim to select all elements with the class "test" and apply the "heading-nav-active" function from the CSS file to each selected element. How can I accomplish this task effectively?