I've got a button that I'm using to show/hide a follow and content. I've been able to change the button to change from saying "View Images as Gallery" to "Hide Image Gallery" - but I cannot get it to revert to "View Images as Gallery" when clicked again. Here is the jQuery:
jQuery(function(){
jQuery(".homeImageGalleryButton").click(function () {
jQuery(".homeHiddenGallery").toggle();
jQuery(".homeImageGalleryButton").toggleClass('homeImageGalleryButtonHide');
jQuery(".homeImageGalleryButtonHide").html("Hide Image Gallery");
});
});
Here is the HTML
<a class="et_pb_button et_pb_button_0 homeImageGalleryButton showGalleryButton">View Images As Gallery</a>
What am I not getting right here? :)
I've tried adating the code here: Change button text - but with no success.