Home >>jQuery Tutorial >jQuery show() Method

jQuery show() Method

jQuery show() Method

jQuery show() method is used to shows the hidden, selected elements.

Syntax:
$(selector).show(speed,easing,callback)

Parameter Values

Parameter Description
speed It is an optional parameter and is used to Specify the speed of the show effect. Its default value is 400 milliseconds

Possible values:

  • milliseconds
  • "slow"
  • "fast"
easing It is an optional parameter and is Specify the speed of the element in points of the animation. Its Default value is "swing"

Possible values:

  • "swing" - faster in the middle, moves slower at the beginning
  • "linear" – it moves in a constant speed
callback It is an optional parameter. After the show() method is completed a function to be executed

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".btn1").click(function(){
$("#show").hide();
});
$(".btn2").click(function(){
$("#show").show();
});
});
</script>
</head>
<body>
<p id="show" style="color:green;">PHPTPOINT</p>
<button class="btn1">Hide</button>
<button class="btn2">Show</button>
</body>
</html>

Output:

PHPTPOINT


No Sidebar ads