-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
26 lines (23 loc) · 863 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const hamburger = document.getElementById('hamburger');
const menu = document.getElementById('menu');
hamburger.addEventListener('click', () => {
menu.classList.toggle('hidden');
});
hlink.forEach(link=>{
link.addEventListener("click",()=>{
menu.classList.toggle("hidden")
hamburger.classList.toggle("bg-white")
})
})
const toggleSection = document.querySelector("#toggleSection");
const toggleButton = document.querySelector("#toggleButton");
toggleButton.addEventListener("click", () => {
// Toggle the 'hidden' class on the section
toggleSection.classList.toggle("hidden");
// Change the button text depending on the visibility
if (toggleSection.classList.contains("hidden")) {
toggleButton.textContent = "SHOW ME";
} else {
toggleButton.textContent = "HIDE ME";
}
});