Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use hide() and show() methods in jQuery ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 188
    Comment on it

    Welcome to findnerd
    Today we are going to discuss hide() method and show() method in jQuery
    firstly, let start hide() method

    hide() method is used for hiding data with HTML elements

    Syntex of hide()

    $(selector).hide();

    And now about show() method
    show() method is used for showing data with HTML elements

    Syntex of hide()

    $(selector).show();

    you can see bellow example for good understanding

    <!DOCTYPE html>
    <html>
    <head>
     <!--  here call the jquery library -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $("#hide").click(function(){
            $("p").hide();// call hide() method on paragraf
        });
        $("#show").click(function(){
            $("p").show();// call show() method on paragraf
        });
    });
    </script>
    </head>
    <body>
    
    <p>Hi all welcome to findered.</p>
    
    <button id="hide">Hide</button>
    <button id="show">Show</button>
    
    </body>
    </html>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: