正确输出编辑的内容格式

<script type="text/javascript">
    $(function () {
        $(".contentxin").each(function() {
            var temp =  $(this).text().replace(/\n|\r\n/g,'<br/>');
            temp = temp.replace(/\s/g,"  ");
            $(this).html(temp);
        });
    })
</script>

猜你喜欢

转载自blog.csdn.net/qq_34944535/article/details/78552115
今日推荐