Jquery – How to write Textlimit Function with keeping the structure of the HTML
jQuery(function($) { $(document).ready(function() { var moreLink = 'Read more'; var lessLink = 'Read less'; // Save the original content $('.container').each(function() { var originalContent = $(this).html(); $(this).data('original-content', originalContent); }); $('.container p').each(function() { var container = $(this).parent(); var wordLimit = parseInt(container.closest(".container").attr('data-word-limit')); var…