Closed Bug 252684 Opened 20 years ago Closed 20 years ago

document.getElementById(someid).childNodes[n] returns wrong element

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 26179

People

(Reporter: christian.juerges, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7.1) Gecko/20040707
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7.1) Gecko/20040707

In the example above I got a <div> element with in 2 other elements identified
by id attribute. When using document.getElementById(path).childNodes[1] it
should return the second element of the div element. But it allways returns
element 1.
When I removed the linefeed and placed the code off the two child directly
behind the div tag it works as expected.

Reproducible: Always
Steps to Reproduce:
Look at the example link.
Actual Results:  
It returns the wrong childelement.

Expected Results:  
Returning the second child element.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
er. wrong bug, sorry.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Not a JS issue.
Assignee: general → general
Component: JavaScript Engine → DOM
QA Contact: pschwartau → ian
And not a bug.  Child _nodes_ and child _elements_ are not the same thing. 
Whitespace ends up in Text nodes.

*** This bug has been marked as a duplicate of 26179 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.