-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass-Click.html
More file actions
42 lines (38 loc) · 908 Bytes
/
Copy pathClass-Click.html
File metadata and controls
42 lines (38 loc) · 908 Bytes
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
<html>
<style>
#para{
font-family: 'Times New Roman', Times, serif;
color: blue;
height: 2px;
}
.summa{
color: pink;
}
</style>
<body>
<p id="par">kugesh is a good boy . yes absolutely</p>
<div id="li">
<ul>
<li>fifth</li>
<li>fourth</li>
<li>third</li>
<li>second</li>
<li>first</li>
</ul>
</div>
<div id="box" style="background:#98bf21;height:100px;width:100px;margin:6px;"></div>
<button id="but" type="submit">click me</button>
<script src="jq\jquery-3.4.1.js"></script>
<script>
/* $("#but").click(function(){
$("#par").addClass("summa");
})*///we can add multiple classes also
/* $("#but").click(function(){
$("#par").removeClass("summa");
})*/
$("#but").click(function(){
$("#par").toggleClass("summa");
})
</script>
</body>
</html>