-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
42 lines (34 loc) · 1.1 KB
/
Copy pathmain.js
File metadata and controls
42 lines (34 loc) · 1.1 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// navabar js start
const list = document.querySelectorAll(".list");
const checkBox = document.querySelector(".checkbox1");
function makeLinkActive() {
list.forEach((item) => {
item.classList.remove("active");
this.classList.add("active");
});
}
list.forEach((item) => {
item.addEventListener("click", makeLinkActive);
});
let body = document.body;
checkBox.addEventListener("change", () => {
document.body.classList.toggle("dark__theme");
});
// navabar js end
//middel button
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
document.getElementById("forgot").addEventListener("click", function(){
alert("oops! contact with register office!");
})