I have tried to make an anchor change it's text when you click on it. But instead of toggling it just goes invisible and doesn't work.
here's the code:
$('a#button').click(function(e) {
e.preventDefault();
findListingBoxList.slideToggle('200');
$(this).toggle(function() {
$(this).html('Hide All');
}, function() {
$(this).html('Show All');
});
});
HTML:
<a id="button" href="#"></a>
<div id="ListingBox">
<ul id="furniture">
<li>Beds</li>
<li>Chairs</li>
<li>Tables</li>
<li>Desks</li>
<li>Shelves</li>
<li>Cabinet</li>
<li>Miscellaneous</li>
</ul>
<ul id="games">
<li>PC</li>
<li>Mac</li>
<li>XBOX 360</li>
<li>Playstation 3</li>
<li>Nintendo Wii</li>
<li>PS Vita</li>
<li>Playstation 2</li>
<li>Playstation</li>
<li>Super Nintendo</li>
<li>Nintendo DS</li>
<li>Miscellaneous</li>
</ul>
</div>
I have already tried it with .html and .text.
findListingBoxListdefined? This version of toggle is deprecated, and removed in 1.9 !