-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObject.html
49 lines (49 loc) · 1.33 KB
/
Object.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
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
<title>Fuction2</title>
<script>
function LinksSetColor(color) {
var alist = document.querySelectorAll("a");
var i = 0;
while (i < alist.length) {
alist[i].style.color = color;
i = i + 1;
}
}
function BodySetColor(color) {
document.querySelector("body").style.color = color;
}
function BodySetBackgroundColor(color) {
document.querySelector("body").style.backgroundColor = color;
}
function nightDayHandler(self) {
var target = document.querySelector("body");
if (self.value === "night") {
Body.setBackgroundColor("black");
Body.setColor("white");
self.value = "day";
Links.setColor("powderblue");
} else {
Body.setBackgroundColor("white");
Body.setColor("black");
self.value = "night";
Links.setColor("blue");
}
}
</script>
</head>
<body>
<h1><a href="index.html">신년계획</a></h1>
<input
id="night_day"
type="button"
value="night"
onclick="nightDayhandler(this);">
<ol>
<li><a href="JS.html">HTML</a></li>
<li><a href="JS2.html">CSS</a></li>
<li><a href="JS3.html">JavaScript</a></li>
</ol>
</body>
</html>