[jQuery] Toggle link - change text
Hello.
Looking for a way to change the text of a toggle link, so when toggled
off the link reads "show" when toggled on the links reads "hide"
Here's what I have:
HTML
*************************************
<a href="#" class="detailstrigger">Show</a>
<div class="filedetails">
The details are here.
</div>
jQuery
*************************************
$(document).ready(function() {
$('.filedetails').hide();
$('.detailstrigger').click(function() {
$('.filedetails').toggle('slow');
});
});
This all works as expected...I'm just trying to find a way to change
the text of the "detailstrigger" depending on the state of the toggle.