JQuery show hide effect html javascript



 Show hide option with animation code

<!DOCTYPE html> 

<html>

<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js">

</script>

<script>

$(document).ready(function(){

$("#hide1").click(function(){

$("h6").hide(1000); });

$("#show1").click(function(){$("h6").show(1500); }); });

</script> 

</head>

<body>

<h6>

<b>This is a little poem: 

</b>

<br/> Twinkle, twinkle, little star<br/>

  How I wonder what you are<br/>

  Up above the world so high<br/>

  Like a diamond in the sky<br/>

  Twinkle, twinkle little star<br/> 

  How I wonder what you are

 </h6>

<button id="hide1">Hide</button>

<button id="show1">Show</button>

</body> 

</html>


Example of show hide script or code :


<!DOCTYPE html> 

<html>

<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js">

</script>

<script>

$(document).ready(function(){ $("#hide").click(function(){ $("h6").hide(); }); $("#show").click(function(){ $("h6").show(); }); });

</script>

</head>

<body>

<h6>

<b>Title of my AIM: </b><br/> Twinkle, twinkle, little star<br/>

 How I wonder what you are<br/> Up above the world so high<br/> Like a diamond in the sky<br/> Twinkle, twinkle little star<br/>

How I wonder what you are

</h6>

<button id="hide">Hide</button> <button id="show">Show</button>

</body> 

</html>

Next Post Previous Post
No Comment
Add Comment
comment url