js文章段落加<p>

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

绝地无双
浏览 795回答 1
1回答

慕尼黑的夜晚无繁华

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;}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript