I have a problem with fade toggle, it works when the div is visible to begin with and the "Show QR" link changes to "Hide QR". The Hide QR link should be clicked and the div hidden, but the link to the text will not change to Show QR
HTML:
<a class="emotTab" id="qrshow" href="javascript:void(0);">Show QR</a>
<div id="div_showqr">Content.....</div>
javasctipt:
$("#qrshow").click(function(){
$("#div_showqr").fadeToggle('slow');
$('#qrshow').text($('#div_showqr').is(':visible')? 'Hide QR' : 'Show QR');
$('#qrshow').text($('#div_showqr').is('display:none')? 'Show QR' : 'Hide QR');
});
source
share