JS中write跟writeln的区别

writeln在结束的位置加了一个换行,但在页面中显示的只是一个空格,放在<pre></pre>里面才会进行换行

  document.write("<pre>第一行");
  document.writeln("第一行");
  document.writeln("这里是第二行");
  document.writeln("这里是第三行");
  document.writeln("这里是第四行</pre>");

原文地址:https://www.cnblogs.com/Zj-fbz/p/10694763.html