Closed Bug 460838 Opened 16 years ago Closed 16 years ago

Changing innerHTML of the <div> tag, which is inside <a> tag adds automatically <a> tag around the text.

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 381808

People

(Reporter: nikita.petrovs, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3

Changing innerHTML of the <div> tag, which is inside <a> tag adds automatically <a> tag around the text.
Haven't tried with different tags but might be affected too.

Reproducible: Always

Steps to Reproduce:
Here's test html code:

<script>
window.onload = function () {	
	alert(document.getElementById('d').innerHTML);
	document.getElementById('d').innerHTML = "123";
	alert(document.getElementById('d').innerHTML);
}
</script>
<body>
<a href="">
	<div id="d">test</div>
</a>
</body>

Open in FF. You'll get two alert boxes. Second is wrong. It shouldn't have <a> tag around "123";
Actual Results:  
First alert box shows "test", second shows "<a>123</a>".

Expected Results:  
First alert box shows "test", second shows "123" without the <a> tag around.
Attached file reporter's testcase
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Component: Content → DOM
QA Contact: content → general
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: