length of childnodes

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
littlecoder
Forum Commoner
Posts: 26
Joined: Fri Oct 17, 2008 4:36 am

length of childnodes

Post 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.
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: length of childnodes

Post by kaszu »

Code: Select all

var len = xmlDoc.documentElement.childNodes[0].childNodes.length;
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: length of childnodes

Post by pickle »

Are you doing this in Javascript? Like, on the Client-Side?

Moving to Client-Side forum.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply