-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageToggle.html
More file actions
42 lines (33 loc) · 1.04 KB
/
ImageToggle.html
File metadata and controls
42 lines (33 loc) · 1.04 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
<html>
<head>
<title>Image hide Toggle</title>
<h1>Image toggle</h1>
</head>
<body>
<button id="btn1">HIDE</button><br><br>
<button id="btn2">SHOW</button><br><br>
<button id="btn3">TOGGLE</button><br><br>
<img id="img1" src="1200px-Toggle_logo.svg.png" alt="" height="100" width="200">
</body>
<script src="https://code.jquery.com/jquery-3.5.1.js"
integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
crossorigin="anonymous">
</script>
<script type="text/javascript">
//from this functions we can do the hide ,show and toggle between them
$(document).ready(function(){
$("#btn1").click(function (){
console.log("image is hidden")
$("#img1").hide();
})
$("#btn2").click(function (){
console.log("image is show")
$("#img1").show();
})
$("#btn3").click(function (){
console.log("image is toggle")
$("#img1").toggle();
})
})
</script>
</html>