-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfuction2.html
46 lines (43 loc) · 1.24 KB
/
fuction2.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
<!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 nightDayhandler(self){
var target = document.querySelector('body');
if(self.value === 'night'){
target.style.backgroundColor = 'black';
target.style.color = 'white';
self.value = 'day';
LinkssetColor('powderblue');
} else {
target.style.backgroundColor = 'white';
target.style.color = 'black';
self.value = 'night';
LinkssetColor('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>