bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

changing nodeValue with javascript of a dl list depends on text formatting

RESOLVED INVALID

Status

()

Firefox
General
--
major
RESOLVED INVALID
13 years ago
13 years ago

People

(Reporter: gerold.meisinger-reg, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8) Gecko/20051111 Firefox/1.5

the following code should change "D" to "X", but it doesnt work:

[code]
<dl>
   <dt>A</dt><dd>B</dd>
   <dt>C</dt><dd>D</dd>
</dl>

<script type="text/javascript">
document.getElementsByTagName("dl")[0].lastChild.lastChild.data = "X";
</script>
[/code]

if i change the formatting of the defintion list to:
[code]
<dl><dt>a</dt><dd>b</dd><dt>c</dt><dd>d</dd></dl>
[/code]

it works. why is that? javascript shouldnt care about text formatting.

Reproducible: Always

Comment 1

13 years ago
Here's why: http://developer.mozilla.org/en/docs/Whitespace_in_the_DOM
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.