XML DOM textContentProperty


Attr object

Definition and Usage

The textContent property sets or returns the text content of the attribute.

Syntax

attrObject.textContent


Example

The following code snippet usesloadXMLDoc()put "Load it into xmlDoc and return the text content of the category attribute:

Example

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>"); }

Output:

COOKING
CHILDREN
WEB
WEB

Try it Yourself »

Try it Yourself


Attr objectother extensions