top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to hide/show elements on a button click?

+3 votes
467 views
How to hide/show elements on a button click?
posted May 18, 2015 by Muskan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
 
Best answer

jQuery hide() and show()

With jQuery, you can hide and show HTML elements with the hide() and show() methods:

Example

$("#hide").click(function(){
    $("p").hide();
});

$("#show").click(function(){
    $("p").show();
});
answer May 20, 2015 by Shivaranjini
Similar Questions
+1 vote

How can i prevent onclick button from multiple click until it's confirmation from javascript if(confirm ) condition.

Note:-Solutions could be easy but not able to track because i am naive in UI development, please help me out.

Here is button

<input type="button" onclick="return saveValues();" value="<?php echo "values" ?>" class="silver_button_big">

Respective javaScript call

var saveValues = function() {
         // some code                
        if(isModified() == false){
            jError("It is modified.");
            return;
            }        
             if(confirm("Are you sure")){
              $.post(base_url + 'google/update_values', {
               //some code               
            }
    };
...