skip to Main Content

Html – How can I change a button's icon when clicking?

I tried the below code but is not showing the 'fa-xmark' rather it's showing the 'fa-bars'. I want 'fa-xmark to show when I click on the 'fa-bars' const toggleBtn = document.querySelector('.toggle_btn') const toggleBtnIcon = document.querySelector('.toggle_btn i') const dropDownMenu = document.querySelector('.dropdown-menu')…

VIEW QUESTION
Back To Top
Search