skip to Main Content

Html – Is there any other way to toggle the button for responsive design, my javascript code isnt working with this

Below is JS Code document.addEventListener("DOMContentLoaded,"); const toggleBtn = document.getElementById('toggle_btn'); const dropDownMenu = document.getElementById('dropdown_menu'); toggleBtn.onclick = function(){ dropDownMenu.classList.toggle('open'); } I want the dropdown menu to get toggled when clicked in the responsive design

VIEW QUESTION
Back To Top
Search