I’m looking for a way to use jQuery to do what I can do in php with wordwrap() (http://php.net/manual/en/function.wordwrap.php)
I would use php but I need the wrapping to happen dynamically after the dom is loaded–
I am not familiar enough with jQuery to write this sort of function from scratch and I have run a few google and stack searches trying to find a premade plugin or something that’s done it already.
Any ideas? Or perhaps a starting place?
Thanks!
EDIT:
for clarification I need to be able to add html at the line breaks (</p><p>, for example)–
as php :
wordwrap($text, 8, "</p><p>", true);
http://james.padolsey.com/javascript/wordwrap-for-javascript/