javascript - Truncate text to fit in 3 lines and show three dots in end In Html -
i need display text paragraph, display 3 lines , truncate test while adding ...(three dots) in paragraph end.
calculate max length of string can fit 3 lines , use following script
var maxlength = 140; var result = yourstring.substring(0, maxlength) + '...';
Comments
Post a Comment