Entry
How do I use the method text?
How do I use the method text?
Apr 16th, 2005 03:12
Martin Honnen,
The method text takes no argument and returns an XMLList containing all
the text child nodes of all the XML objects contained in this XMLList
the method is called on. This is done by calling the method text
(http://www.faqts.com/knowledge_base/view.phtml/aid/35501/fid/1784) on
each XML element object contained in the list and concatenating the results.
Here is an example:
var godList = <>
<god>Kibo</god>
<god>Xibo</god>
</>;
alert(godList.text().length()); // shows 2
alert(godList.text().toXMLString());
/* shows
'Kibo
Xibo'
*/