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

Text.isElementContentWhitespace

已废弃
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

返回一个布尔值,表明该文本节点的内容是否全部是由空白符组成的.

警告: 该属性已经在DOM level 4中被废弃, 在一些新版本的浏览器(Gecko 10.0 )中已经被删除.

语法

b = textnode.isElementContentWhitespace;

例子

下例中 ,我们创建了一个内容为空白符和文字组成的文本节点.该节点的isElementContentWhitespace属性为false.

var tn = document.createTextNode("Hello world");
tn.isElementContentWhitespace; /* 返回false */

下例中 ,我们创建了一个内容全部为空白符的文本节点.该节点的isElementContentWhitespace属性为true.

var ws = document.createTextNode("  \t \r\n   ")
ws.isElementContentWhitespace; /* 返回true */

规范

DOM Level 3 Core: Text.isElementContentWhitespace

相关链接

文档标签和贡献者

 此页面的贡献者: teoli, khalid32, ziyunfei
 最后编辑者: khalid32,