I have a text in a h2 tag that I’m limiting its character count with by:
$(function() {
$('h2.questionTitle a').each(function() {
var $this = $(this);
$this.text( $this.text().slice(0,80);
});
});
However, I also want to modify the code so that if the character count was sliced at 80 chars, add “…” to the end of it. How could I do this?
http://jsfiddle.net/yGqSK/