-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path03.html
39 lines (39 loc) · 1.02 KB
/
03.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>visibility 프로퍼티</title>
<style>
span {
visibility: hidden;
color: blue;
}
</style>
<script>
function show() {
let objArray = document.getElementsByTagName("span");
for (let i = 0; i < objArray.length; i++) {
let obj = objArray[i];
let style = window.getComputedStyle(obj);
let v = style.getPropertyValue("visibility");
if (v == "hidden")
obj.style.visibility = "visible";
else
obj.style.visibility = "hidden";
}
}
</script>
</head>
<body>
<h3>다음 빈 곳에 숨은 단어?
<button onclick="show()">show/hide</button>
</h3>
<hr>
<ul>
<li>I (<span>love</span>) you.
<li>CSS is Cascading
(<span>Style</span>) Sheet.
<li>응답하라 (<span>1988</span>).
</ul>
</body>
</html>