I have two div elements associated with button means each div contains a its button for ‘show/hide’ functionality.
<input type="button" id="btn1" value="Show/Hide" />
<div id="panel1" class="pnl1"></div>
<input type="button" id="btn2" value="Show/Hide" />
<div id="panel2" class="pnl1"></div>
I am using the javascript as :
$('#panel1,#panel2').hide();
$('#btn1').click(function(){
$('#panel1').fadeOut();
});
$('#btn2').click(function(){
$('#panel2').fadeOut();
});
this code hide only. And after hiding div how I can show again on the same button’s click.