faqts : Computers : Programming : Languages : JavaScript : XML : E4X (ECMAScript for XML) : XML objects

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

How do I use the method text?
How do I use the method text?

Apr 12th, 2005 03:27
Martin Honnen,


The method text takes no argument and returns an XMLList with all the
children of this XML object that represent text nodes.
Here are some examples:
  var p = <p>Kibology for <b>all</b>. All for <b>Kibology</b>.</p>;
  var textNodeList = p.text();
  alert(textNodeList.length()); // shows 3
  alert(textNodeList.toXMLString());
  /* shows
  'Kibology for
   . All for
   .'
  */