How can I change the text of a <span> element?

Rune-Haven

New Member
I have a toggle button that I'm adding to an iFrame:\[code\]<script> $('#list div').each(function(){ $(this).append('<span class="togglebutton">Maximize</span>'); }); $("span.togglebutton").click(function() { $(this).closest("li").children("div").toggleClass("maximized"); });</script>\[/code\]How can I change the toggle between the text Maximize/Minimize when the toggleClass is maximized?
 
Top