i have a button at the bottom of my page, and when the user scrolls to the bottom of the page a class gets added called 'done'. (this is all handled through a plugin).
i'm trying to change the text of this button when this class gets added. i have worked this script up but have no idea why it's not working?
jquery
jQuery(document).ready(function(){
if ( $('#load-more').hasClass('done') ) {
$(this).text('No more posts to load');
};
});
html
<button id="load-more" class="alm-load-more-btn more done">Load more posts...</button>