Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

document.writeln

概述

向文档中写入一串文本,并紧跟着一个换行符。

语法

document.writeln(line); 

参数

  • line 为包含文本的字符串

示例

document.writeln("<p>enter password:</p>"); 

备注

document.writelndocument.write 一样,但是会添加一个换行符。

Note: document.writeln (like document.write) does not work in XHTML documents (you'll get a "Operation is not supported" (NS_ERROR_DOM_NOT_SUPPORTED_ERR) error on the error console). This is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml MIME type. More information is available in the W3C XHTML FAQ.

规范

writeln

文档标签和贡献者

 此页面的贡献者: teoli, jsx, AlexChao
 最后编辑者: jsx,