首页 > js文章段落加<p>

js文章段落加<p>

用户上传了一篇文章,怎么进行分段,就是加<p>标签。


大致如下

function add_p(get_cont){
var get_cont = get_cont.trim;
var count = '<p>' + get_cont + '</p>';
count_str = count.replace(/\s+/g,'</p><p>');
return count_str;
}
【热门文章】
【热门文章】