I found on the internet a way to limit the number of characters; which is this:
jQuery
var myDiv = $('#your-div-id');
myDiv.text(myDiv.text().substring(0,300))
I'd like to limit the number of words. I have this code but I don't know how to use it to do what I want.
jQuery
var primo = document.getElementById('faketxt');
var wordLimit = 215;
var words = primo.textContent.replace(/(<([^>]+)>)/ig,"").split(/\s/);