- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaScript_Accordian.html
More file actions
Latest commit
82 lines (73 loc) · 2.79 KB
/
Copy pathJavaScript_Accordian.html
File metadata and controls
82 lines (73 loc) · 2.79 KB
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
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="UTF-8" />
<metaname="viewport" content="width=device-width, initial-scale=1.0" />
<title>🏴‍☠️ Complete Javascripts Course</title>
<linkhref="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous" />
<style>
.con {
border:1px solid black;
padding:20px;
font-size:0.8em;
display: none;
}
.acc {
font-size:1.5em;
background-color:#ddd;
}
.active {
display: block;
}
</style>
</head>
<body>
<br/>
<br/>
<center>
<!-- <input type="text" id="item"> -->
<br/>
<divid="wrapper">📃 🏪 👾</div>
<br/>
<divclass="acc">Information about JavaScript</div>
<divclass="con">Complete JavaScript Course Complete JavaScript Course Complete JavaScript Course
<imgsrc="https://via.placeholder.com/300.png/09f/fff" alt="image">
</div>
<divclass="acc">More Read JavaScript</div>
<divclass="con">Blah blah blah blah e
<imgsrc="https://via.placeholder.com/300.png/ff000/fff" alt="image"></div>
<divclass="acc">More Read JavaScript</div>
<divclass="con">Blah blah blah blah e </div>
<divclass="acc">More Read JavaScript</div>
<divclass="con">Blah blah blah blah e </div>
<divclass="acc">More Read JavaScript</div>
<divclass="con">Blah blah blah blah e </div>
<divclass="acc">More Read JavaScript</div>
<divclass="con">Blah blah blah blah e </div>
<br><br><br>
<ahref="./Adding_&_Removing_Classes.html"><buttontype="button" class="btn btn-outline-warning">Adding_Removing_Classes</button></a>
</center>
<script>
varaTitle=document.querySelectorAll('.acc');
varc=document.querySelectorAll('.con');
for(varx=0;x<aTitle.length;x++){
aTitle[x].onclick=function(){
cCon(this.nextElementSibling);
this.nextElementSibling.classList.toggle('active');
}
}
functioncCon(t){
for(varx=0;x<c.length;x++){
if(t!=c[x]){
c[x].classList.remove('active');
}
}
}
</script>
<scriptsrc="https://code.jquery.com/jquery-3.5.0.js" integrity="sha256-r/AaFHrszJtwpe+tHyNi/XCfMxYpbsRg2Uqn0x3s2zc="
crossorigin="anonymous"></script>
<scriptsrc="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<scriptsrc="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script>
</body>
</html>