Just another way to write the same solution as others have provided:
$('a').text(function(index, oldText) { return oldText.length > 10 ? oldText.substring(0, 10) +'...' : oldText;});
Just another way to write the same solution as others have provided:
$('a').text(function(index, oldText) { return oldText.length > 10 ? oldText.substring(0, 10) +'...' : oldText;});