childnodes problem

This is a discussion on "childnodes problem" within the JavaScript Forum section. This forum, and the thread "childnodes problem are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 4th, 2007, 14:06
enk enk is offline
New Member
Join Date: Mar 2007
Location: israel
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
childnodes problem

Hi!
I'm really new to web programming. I've got the following code:
<div id = "divrow1" name="divrow1">
<tr id="row1.1" style="display=none;" name="row1.1">
<td>&nbsp;<img id= 'imgrow1.1' src='images/plus.gif' <onclick='changeVis("row1.1", 3);' > Welcome</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</div>

It's all placed within a <table> tag.
div = document.getElementById("divrow1");
Why do I get zero for div.childNodes.length?
Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 4th, 2007, 20:23
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: childnodes problem

To start with your structure is wrong.

You can't just stick <tr> elements inside a <div>.

To be strictly correct, you should have a <table> element followed by a <tbody> element and then your <tr> elements.

You need to propely close the structure obviously.

If you do not, you will get different responses depending on the browser you are using.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
childnode

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
First image problem and inline list problem konnor5092 Web Page Design 8 Dec 1st, 2007 09:08


All times are GMT. The time now is 20:22.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42