write()和writeln()的区别,为什么在浏览器中显示一样
write()和writeln()的区别是什么?
writeln()为什么不换行
document.writeln("just");
document.write("a");
document.write("test");
貌似只插入了一个空格的样子
document.writeln("aaa");
等于
document.write("aaa"+"\n");
html是忽略换行符(\n)的,除非是在<pre></pre>中
<pre> <script type="text/javascript"> document.writeln("A"); document.write("B"); document.write("C"); </script> </pre>