Define show() method of jQuery in detail.

The jQuery show() method is used to show the hidden elements of HTML in the web document. Note that, the show method would not show elements which property are set to Hidden by visibility property, i.e. visibility: hidden in CSS.
The elements that are hidden by using the hide() method or with CSS property display: none; can be shown by using the show() method.

Syntax of jQuery show

Following is the syntax of show method
Selector = This can be an HTML element like div, p, list etc.
Speed = This is an optional parameter with three possible values:
Value in milliseconds
Callback = after the jQuery show() method is executed, an optional callback function can be used.

Example of using show method

Following example shows how to use the show method. We have used a div element that contains a yellow line with text, which is hidden initially. As you click on the button the div element will be shown by using the show method.

<!DOCTYPE html>


<title>jQuery Testing</title>
   <script src=""></script>
   <script type="text/javascript" language="javascript">
   $(document).ready(function() {
     $(".hidetext").click(function () {
   <button class="hidetext">Show yellow line</button>
   <div class="text" style="background-color:yellow;display: none;">
     This is Yellow line!!

Need Help? Contact Us.

Log in


Forgot password?


New User