Closed
Bug 214722
Opened 23 years ago
Closed 23 years ago
cannot reach body element by nextSibling of the head element
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: yoichi, Unassigned)
Details
(Keywords: testcase)
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624
In the following HTML, document.documentElement.firstChild.nextSibling.tagName
returns "undefined", although document.documentElement.lastChild.tagName returns
"body" correctly.
<html>
<head><title>sample</title></head>
<body>
<p
onMouseOver="this.firstChild.data=document.documentElement.firstChild.nextSiblin
g.tagName"
onMouseOut="this.firstChild.data=document.documentElement.lastChild.tagName">bod
y string</p>
</body>
</html>
Reproducible: Always
Steps to Reproduce:
1. open the sample html file
2. put mouse cursor on the paragraph
Actual Results:
text is replaced to "undefined"
Expected Results:
text is replaced to "body"
Comment 1•23 years ago
|
||
There's a text node in between HEAD/BODY (I see it using the DOM Inspector).
If you change your example to:
<html><head><title>sample</title></head><body>...
then it works fine.
*** This bug has been marked as a duplicate of 2750 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Keywords: testcase
OS: Windows XP → All
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•