[thelist] Getting Child Elements from an HTML Element in JS

Chris Evans chris at unhappyfun.com
Tue Jul 8 09:04:59 CDT 2003


How do I retrieve the child elements of a HTML ELement using Javascript? 
  For example, I have this:

<div id ="topDiv">
     <div id="parentDiv1">
	<div id="childDiv1">
	</div>
	<div id="childDiv2">
	</div>
     </div>
</div>

Given the element parentDiv1, how would I go about retrieving childDiv1 
and childDiv2 programmatically?

Thanks,

Chris Evans
http://www.fuseware.com



More information about the thelist mailing list