wrapping text words in new line

后端 未结 8 725
眼角桃花
眼角桃花 2021-02-10 04:53

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 (         


        
8条回答
  •  再見小時候
    2021-02-10 05:04

    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.

提交回复
热议问题