[jQuery] how to toggle text
Hello,
I begin with jQuery so....
looks like one toggle function is missing : how can be accomplished
the change of a text in a link , (and it's title or a alt text)
between to possible states :
ie:
I use this to hide/display a content div a linl and this :
$("#toggle-content").click(function(){
$("#contenu").toggle();
$("#toggle-content").toggleClass("ouvert");
this will add a class to the link #toggle-content to make it "" when
closed (default) or ".ouvert" when opened.
BUT the link remains the same, and it's actually not very cool or
accessible to display something like "read more" when it's already
opened, and the text should be now "click here to hide"
Of course, dealing with toggleClass, it's possible to use a full
graphic background-image that tells the right stuff, but the title AND
the alt of the link must be change anyway.
any one had already done this ?
Thank you.