I have some content that I want to show / hide using jquery. So far using the code below:
$(document).on("click",".class", function(){ $(this).next().slideToggle("fast"); }); <div class="class" Title="Click to view/hide all" id="flip">View ▼</div> <div class="class" id="panel"><table> Hello!! </table> </div>
I have many such div views that are created and work inside a loop. My show / hide content is working fine, but I want to change the text (on the button) to βshowβ and βhideβ when the user clicks. Please, help.
source share