Faqts : Business : Programming : Shopping For You : 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
Shopping Snooper, Casino Vendor Directory, 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
   .'
  */