You are here

Limit text lenght with jquery

$("div.some-area").text(function(index, currentText) {
    return currentText.substr(0, 175);
});

if you want to add ellipses at the end:

$("div.some-area").text(function(index, currentText) {
    return currentText.substr(0, 175)+'...';
});
code type: