-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript1.js
More file actions
22 lines (19 loc) · 842 Bytes
/
Copy pathscript1.js
File metadata and controls
22 lines (19 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// script1.js
document.addEventListener("DOMContentLoaded", function() {
// Add any JavaScript code you want to run after the DOM is fully loaded
const hamburger = document.querySelector('.hamburger');
const navUL = document.querySelector('nav ul');
hamburger.addEventListener('click', function() {
hamburger.classList.toggle('active');
navUL.classList.toggle('active');
});
// Example: Change the background color of the body when the page loads
document.body.style.backgroundColor = "#e0f7fa";
// Example: Add an event listener to navigation links
// const navLinks = document.querySelectorAll("nav ul li a");
// navLinks.forEach(link => {
// link.addEventListener("click", function() {
// alert("You clicked a navigation link!");
// });
// });
});