I am fetching data from a collection. For a single field (it has large amount of characters), i want to limit the number of characters like (200 or 250).
I don’t want to put any condition on the Cms backend, just want to put this condition while fetching the data and display it on frontend.
Hey @Romey_Gill Try this <script> $(".your class goes here").each(function () { //replace 50 with your desired number of character's var truncated = $(this).text().substr(0, 50); //checking and replacing with "..." length is less than your desired number of character's $(this).text(truncated + (truncated.length < 50 ? "" : "...")); }); </script>