/ Published in: jQuery

Limit string length/trim text with jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery(document).ready(function($){ $("h3").each(function(){ if ($(this).text().length > 30) { $(this).text($(this).text().substr(0, 27)); $(this).append('...'); } }); });
Comments
