-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomManipulation6.html
More file actions
48 lines (39 loc) · 1.25 KB
/
Copy pathDomManipulation6.html
File metadata and controls
48 lines (39 loc) · 1.25 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
<html>
<head>
<title>Dom manipulations</title>
</head>
<body>
<link rel="stylesheet" href="style.css">
<div id="div1" class="divclass">
<button id="btn1">ADD</button>
<button id="btn2">REMOVE</button>
<button id="btn3">TOGGLE</button>
<button id="btn4">CSS</button>
<p id="p1">this is paraghaph 1</p><br>
<p id="p2">this is paraghaph 2</p><br>
<p id="p3">this is paraghaph 3</p><br>
<p id="p4">this is paraghaph 4</p><br>
</div>
</body>
<script
src="https://code.jquery.com/jquery-3.5.0.js"
integrity="sha256-r/AaFHrszJtwpe+tHyNi/XCfMxYpbsRg2Uqn0x3s2zc="
crossorigin="anonymous">
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#btn1").click(function(){
$("#div1").addClass("class2")
})
$("#btn2").click(function(){
$("#div1").removeClass("class2")
})
$("#btn3").click(function(){
$("#div1").toggleClass("class2")
})
$("#btn4").click(function(){
alert($("#div1").css("font-family"))
})
})
</script>
</html>