概述:Document时Window对象的子对象。由于Window对象是Dom对象模型中的默认对象,因此其方法和子对象不需要使用window来引用
write方法和writelm方法作用相同,唯一的区别在于 writeln在输出的内容后添加一个按enter键换行符但是需要用pre标记内才能被识别比如:
<pre>
<script>
document.writeln("枫桥夜泊<p>")
document.writeln("月落乌嘀霜满天")
document.writeln("江枫渔火对愁眠")
document.writeln("姑苏城外寒山寺")
document.writeln("夜半钟声到客船")
</script>
</pre>
否则不会有换行效果