-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (39 loc) · 1.3 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="icon" type="image/x-icon" href="favicon.svg">
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav>
<img class="nav" src="favicon.svg" alt="" height="50px">
<ul type="none">
<li class="nav"></li>
<li class="nav">Beranda</li>
<li class="nav">Tentang Saya</li>
<li class="nav">Portfolio</li>
<li class="nav">Clients</li>
<li class="nav"><a href="blog.html">Blog</a></li>
<li class="nav">Contact</li>
</ul>
<p><button class="nav" onclick="myFunction()" id="dark-mode" class="light-mode">Darkmode</button></p>
</nav>
<script>
function myFunction() {
var x = document.getElementById("dark-mode");
if (x.innerHTML === "Darkmode") {
var element = document.body;
element.classList.toggle("dark-mode");
x.innerHTML = "Lightmode";
} else {
x.innerHTML = "Darkmode";
var element = document.body;
element.classList.toggle("light-mode");
}
}
</script>
</body>
</html>