JS换行可以添【< br />】,方式如下
<script>
document.write('hello <br/>world')
</script>
JS 添加空格可以采用如下两种方式:
插入【 】
<script>
document.write('hello     world')
</script>
或者:
插入语句【"< span style=‘white-space:pre;’>"】和【’</ span>’】,注意前一句的双引号
<script>
document.write("<span style='white-space:pre;'>"+'h ello wor ld'+'</span>')
</script>