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