I have two buttons set as hidden :
<input type="button" id="a" style="display:none;" value="A" />
<input type="button" id="b" style="display:none;" value="B" />
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 :
$(document).ready(function() {
var condition = "<?php echo $condition; ?>"; //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();
}
});