Hello.
Does JavaScript have a way of truncating HTML text without all the headaches of matching tags etc etc?
Thank you.
Hello.
Does JavaScript have a way of truncating HTML text without all the headaches of matching tags etc etc?
Thank you.
There's nothing built-in javascript. There's a jQuery plugin that you might take a look at.
That's quite challenging.
If you don't have any HTML markup, the following might be useful.
Try using the javascript substring or slice string functions, depending on how you want to truncate.