jQuery - Read More / Read Less. How to replace text?
问题 HTML: <a href="#" class="show_hide" data-content="toggle-text">Read More</a> jQuery: // Slide Up Slide Down $('.show_hide').toggle(function(){ $(this).text().replace("Read More", "Read Less"); $('.' + $(this).attr('data-content')).slideDown(); },function(){ $(this).text().replace("Read Less", "Read More"); $('.' + $(this).attr('data-content')).slideUp(); }); I am trying to make one of those "Read More / Read Less" buttons to hide and show text. How do I replace "Read More" with "Read Less" on