Answers for "limit characters displayed in span"

0

limit characters displayed in span

$(document).ready(function(){
  
  $('.txtReduce').each(function (f) {

      var newstr = $(this).text().substring(0,20);
      $(this).text(newstr);

    });
})


in HTML : 
<span class="txtReduce" th:maxlength="20"
Posted by: Guest on March-30-2021

Browse Popular Code Answers by Language