How to truncate a text with JavaScript

If we have a long long text and we only want to show our users some part of that text, well we need to truncate that text. In this tutorial I will show you how to do that with JavaScript.

And here is the source code:

Published by


Habibie is an Indonesian freelance programmer familiar with PHP, MySQL, HTML5, CSS3, JavaScript, Java, Swift, Python and C#. He makes Android and iOS games and apps. He's also good at graphics design, video editing, visual effect and animation.

Leave a Reply

Your email address will not be published. Required fields are marked *