-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path07 Disappearing Circles.html
115 lines (110 loc) · 4.07 KB
/
07 Disappearing Circles.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<html lang="en">
<head><title>Mini Challenge - Disappearing Circles</title>
<style type="text/css">
.circle{
width:200px;
height:200px;
border-radius: 50%;
margin: 20px;
float: left;
}
#blue{
background-color: blue;
}
#pink{
background-color: pink;
}
#choclate{
background-color: chocolate;
}
#orange{
background-color: orange;
}
#grey{
background-color: grey;
}
#yellow{
background-color: yellow;
}
#green{
background-color: green;
}
#red{
background-color: red;
}
#slateblue{
background-color:slateblue;
}
#gold{
background-color: gold;
}
h2{
text-align: center;
}
button{
font-size: 150%;
/*making button in center*/
margin: auto;
background-color:pink;
border-radius: 5px;
border: 5px black dotted;
display: none;
}
</style>
</head>
<body>
<h2 >Click on Circles to make them Disappeare</h2>
<button id="btn">Bring Circles back</button>
<div class="circle" id="blue"></div>
<div class="circle" id="pink"></div>
<div class="circle" id="choclate"></div>
<div class="circle" id="orange"></div>
<div class="circle" id="grey"></div>
<div class="circle" id="yellow"></div>
<div class="circle" id="green"></div>
<div class="circle" id="red"></div>
<div class="circle" id="slateblue"></div>
<div class="circle" id="gold"></div>
<script type="text/javascript">
document.getElementById("blue").onclick=function(){
document.getElementById("blue").style.display="none";
}
document.getElementById("pink").onclick=function(){
document.getElementById("pink").style.display="none";
}
document.getElementById("choclate").onclick=function(){
document.getElementById("choclate").style.display="none";
}
document.getElementById("orange").onclick=function(){
document.getElementById("orange").style.display="none";
}
document.getElementById("yellow").onclick=function(){
document.getElementById("yellow").style.display="none";
}
document.getElementById("green").onclick=function(){
document.getElementById("green").style.display="none";
}
document.getElementById("red").onclick=function(){
document.getElementById("red").style.display="none";
}
document.getElementById("slateblue").onclick=function(){
document.getElementById("slateblue").style.display="none";
}
document.getElementById("grey").onclick=function(){
document.getElementById("grey").style.display="none";
}
document.getElementById("gold").onclick=function(){
document.getElementById("gold").style.display="none";
document.getElementById("btn").style.display="block";
}
document.getElementById("btn").onclick=function(){
var ids=["grey","gold","slateblue","red","green","yellow","orange","choclate","pink","blue"];
// document.write(ids.length);
for(var i=0;i<ids.length;i++){
document.getElementById(ids[i]).style.display="block";
}
document.getElementById("btn").style.display="none";
}
</script>
</body>
</html>