I\'m using the below code for wrapping long text, entered by users in a text area for commenting:
function addNewlines(comments) { var result = \'\'; while (
I believe wrapping a text by CSS is a better solution however there is a link here which may be helpful wrap-text-in-javascript
by the way i remember there is a JQuery plugin for wrapping text google it too.