title: jquery click to hide and show another button
body: <p>I have two buttons set as hidden :</p>
  
  <pre><code>&lt;input type="button" id="a" style="display:none;" value="A" /&gt;
  &lt;input type="button" id="b" style="display:none;" value="B" /&gt;
  </code></pre>
  
  <p>I have a jquery where I check some conditions fetched from the database. Either one of the button will be shown and that depends on if the condition is 1 or 0..That means when I click any of the button it must get hidden and the other one must shown up..? But it's not happening..The button I click gets hidden and the other button isn't shown up..If anyone can help.. My jquery :</p>
  
  <pre><code>$(document).ready(function() {
          var condition = "&lt;?php echo $condition; ?&gt;"; //i get this from database
          var c = condition;
  
  
          if(c == 0){
  
                  $('#a').css({'display':''});
              $('#a').click(function(){
              $('#a').hide();
              $('#b').show();
  
                    });   
          }else if(c == 1){
  
                  $('#b').css({'display':''});
              $('#b').click(function(){
              $('#b').hide();
              $('#a').show();
          }
          });
  </code></pre>