XML DOM textContent 属性

定义和用法
textContent 属性设置或返回属性的文本内容。
语法
attrObject.textContent
下面的代码片段使用 books.xml" 载入 xmlDoc 中,并返回 category 属性的文本内容:
实例代码
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].textContent);
document.write("<br>");
}
输出:
COOKING
CHILDREN
WEB
WEB
CHILDREN
WEB
WEB
textContent - 设置属性的文本内容
