I have DIV Content and HIDE/SHOW hyper link. The functionality is not happening as expected. Initially the div content is visible with hide link, once user click HIDE link the DIV content get close and link value change into SHOW. once user click back it should show DIV content and change the SHOW link to HIDE
<div id="collapse1">
content
</div>
<a href="#collapse1" class="nav-toggle">Hide</a>
$('.nav-toggle').click(function()
{
var txtValue = $('.nav-toggle').text();
$('#collapse1').toggle('fast');
if(txtValue = 'Hide'){$('.nav-toggle').html('Show');}
else if(txtValue = 'show'){
$('.nav-toggle').text('hide');}
});
Demo code: http://jsfiddle.net/dkdRt/5/