-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.html
34 lines (34 loc) · 975 Bytes
/
jquery.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
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
.red{
color: red;
}
</style>
</head>
<body>
<p>Hello Red</div>
<p>Hello Blue</div>
<p>Hello yellow</div>
<p style="display: none;">Hello World!</p>
<button id="fadin">Fade In</button>
<button id="fadout">Fade Out</button>
<script>
$(document).ready(function(){
$("p").dblclick(function(){
$(this).toggleClass("red");
});
});
$(document).ready(function(){
$("#fadin").click(function(){
$("p").fadeIn("slow");
});
$("#fadout").click(function(){
$("p").fadeOut("slow");
});
});
</script>
</body>
</html>