14 lines
549 B
JavaScript
14 lines
549 B
JavaScript
|
document.addEventListener('DOMContentLoaded', function() {
|
||
|
const toggleBtn = document.getElementById('toggle_btn');
|
||
|
const toggleBtnIcon = document.getElementById('toggle_btn_icon');
|
||
|
const dropDownMenu = document.getElementById('dropdown_menu');
|
||
|
|
||
|
toggleBtn.addEventListener('click', function() {
|
||
|
dropDownMenu.classList.toggle('open');
|
||
|
const isOpen = dropDownMenu.classList.contains('open');
|
||
|
|
||
|
toggleBtnIcon.classList = isOpen
|
||
|
? 'fa-solid fa-xmark'
|
||
|
: 'fa-solid fa-bars';
|
||
|
}, false);
|
||
|
}, false);
|