Jump to content

Xml Dom Length Property


Guest Daniel4343

Recommended Posts

Guest Daniel4343

Hello,Sorry for my english, I am a french speaker ! So if you can write in french, I appreciate. But I can read english. I understand the following exemple from XML DOM tutorial, but I have some difficulties to interpret or understand length property : for (i=0;i<x.length;i++) So, please, what means i<x.length ? I understand i=0 and i++, but what means i<x.length ? i is little than what ???<html><head><script type="text/javascript" src="loadxmldoc.js"></script></head><body><script type="text/javascript">xmlDoc=loadXMLDoc("books.xml");x=xmlDoc.getElementsByTagName("title");for (i=0;i<x.length;i++) { document.write(x.childNodes[0].nodeValue); document.write("<br />"); }</script></body></html>Thank you for your helpDaniel

Link to comment
Share on other sites

The length property of a node list tells you how many elements there are in the list.In this case, x.length tells you how many <title> elements are in the XML document.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...