Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to hide particular div with just one click?

    • 0
    • 3
    • 3
    • 1
    • 0
    • 0
    • 0
    • 0
    • 2.59k
    Comment on it

    Hi, you want a condition in which the particular div, para or any other tag need to be disappear with just a single click see my code written in jquery as simplest.

    <script>
    $(document).ready(function(){
        $("p").click(function(){
            $(this).hide();
        });
    });
    </script>
    

    A simple three phase of working code is here.

    1. Loading of document
    2. Define which tag should be selected (you can select
      also, but

      in this case).

    3. Choose what you want to deal with selected tag (hide in this case).

    And your html code section will go like this

    <p>Since you selected p tag to disappear. This will gone on just a single click.</p>
    

 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: