forked from Ankit-raj-droid/Advanced_Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
22 lines (18 loc) · 625 Bytes
/
script.js
File metadata and controls
22 lines (18 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const buyItems = ["Laptop", "Headphones", "Keyboard"];
const sellItems = ["Phone", "Monitor", "Mouse"];
const buyList = document.getElementById("buyList");
const sellList = document.getElementById("sellList");
buyItems.forEach(item => {
const li = document.createElement("li");
li.textContent = item;
buyList.appendChild(li);
});
sellItems.forEach(item => {
const li = document.createElement("li");
li.textContent = item;
sellList.appendChild(li);
});
const themeToggle = document.getElementById("themeToggle");
themeToggle.addEventListener("click", () => {
document.body.classList.toggle("dark-mode");
});