Hello
Assume I have the following HTML tags:
[code]
<div id=”container”
<div id=”a” />
<div id=”b” />
<div id=”c”>
<div id=”d” />
</div>
<div id=”e” />
</div>
I need to write a JavaScript code that does the following:
Get a reference to the “container” element
get an array of all its [b]direct
Iterate over its children array and print their id value
In the example above, the direct children would be:
a, b, c and e
Note the [b]d is left out
I need the code to run on both IE and Firefox
I need a solution that will work even if the container’s direct children are not div elements, but any html tags
any help would be appreciated