0
   

show image on click button

 
 
Reply Sun 1 Jan, 2017 07:21 am
i want to use button tage to hide and show image.
atried this in <p> tag
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<img src="http://essamothman.neocities.org/sam.png">
<button id="hide">Hide</button>
<button id="show">Show</button>

</body>
</html>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 1,185 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » show image on click button
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/26/2024 at 12:35:22