[jQuery] click() - toggle content and change content

[jQuery] click() - toggle content and change content


Hope someone can give me a tips:
I am very new to this, and I am trying to change the content in a list
element tag after an event has occured, and then change the content back
again...
First, the <p class="theBody"> is hidden, and when I click "SHOW body" it is
made visible and the content of the changes to "HIDE body". But when I
click to toggle the

again, I want the text to go back to "SHOW body".
Here is the code so far:
function init() {
        $(".roundbox .thebody").hide();
        $("#container").find(".roundbox ul").prepend("<li class='readbody'> # SHOW
Body </li>");
        
        $(".actions li.readbody a").click(function() {
            $(this.parentNode.parentNode.parentNode).find(".thebody").toggle("slow");
            $(this).html("HIDE body");
        });
}
--
View this message in context: http://www.nabble.com/click%28%29---toggle-content-and-change-content-tf3160764.html#a8766616
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/