-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToggle.html
More file actions
30 lines (30 loc) · 814 Bytes
/
Toggle.html
File metadata and controls
30 lines (30 loc) · 814 Bytes
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Browser</title>
</head>
<style>
.hidden {
display: none;
}
</style>
<body>
<button id="button">Click me</button>
<h1 id="head">Write, edit and run HTML, CSS and JavaScript code online.</h1>
<p>
Our HTML editor updates the webview automatically in real-time as you
write code.
</p>
<script src="script.js"></script>
</body>
<script>
let button = document.getElementById("button");
let head = document.getElementById("head");
button.addEventListener("click", function () {
head.classList.toggle("hidden");
});
</script>
</html>