Page 1 of 1

length of childnodes

Posted: Sat Oct 25, 2008 11:18 am
by littlecoder
Hi,

I am actually looking for a way to find the length of the first childNode . I tried the following code :
var len = xmlDoc.documentElement.childNodes[0].length;
alert(len);

I am getting an 'undefined' in the alert box.Does any one know the solution.

Re: length of childnodes

Posted: Thu Nov 06, 2008 4:37 pm
by kaszu

Code: Select all

var len = xmlDoc.documentElement.childNodes[0].childNodes.length;

Re: length of childnodes

Posted: Thu Nov 06, 2008 5:16 pm
by pickle
Are you doing this in Javascript? Like, on the Client-Side?

Moving to Client-Side forum.