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)
Core
DOM: Core & HTML
Tracking
()
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.
Updated•20 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Comment 1•20 years ago
|
||
er. wrong bug, sorry.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 2•20 years ago
|
||
Not a JS issue.
Assignee: general → general
Component: JavaScript Engine → DOM
QA Contact: pschwartau → ian
Comment 3•20 years ago
|
||
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 ago → 20 years ago
Resolution: --- → DUPLICATE
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•