Closed
Bug 41479
Opened 25 years ago
Closed 25 years ago
Problems with event in InnerHTML
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
People
(Reporter: violaine.lebeaupin, Assigned: joki)
Details
When an element with events is defined in a string which is used with
innerHTML, the functions associated to these events aren't called.
In my case test, I have two DIV's tag. The content of the first is implemented
dynamicaly with innerHTML. The content of the second DIV's tag is implemented
staticaly.Only the events of the second DIV's tag work correcly.
My case test works with IE5.
CASE TEST :
<html>
<head>
<script>
function select (elt)
{
elt.style.backgroundColor="yellow";
}
function deselect (elt)
{
elt.style.backgroundColor="blue";
}
function creer()
{
var src;
src = "<table><tr onmouseover='select(this)' onmouseout='deselect
(this)'><td>First</td><td>Second</td></tr></table>";
document.getElementById("thediv").innerHTML = src;
}
</script>
</head>
<body>
<input type="submit" value="Créer" onclick="creer()"></input>
<div id="thediv"></div>
<div>
<table>
<tr onmouseover="select(this)" onmouseout="deselect(this)">
<td>Un</td><td>Deux</td>
</tr>
</table>
</div>
</body>
</html>
Comment 1•25 years ago
|
||
If I recall correctly, innerHTML is a proprietary MS thing for their version of
the DOM.
For more info, see:
http://www.faqts.com/knowledge-base/view.phtml/aid/970/fid/128/lang/en
Comment 2•25 years ago
|
||
adding myself (should have done this with the last update, sorry)
Comment 3•25 years ago
|
||
Not sure what to do with this bug, this'll probably be fixed when bug 7997 is
fixed...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 4•25 years ago
|
||
Handing this one over to Tom.
Assignee: jst → joki
OS: Windows 98 → All
Hardware: PC → All
| Assignee | ||
Comment 5•25 years ago
|
||
Duping on the same bug for createContextualFragment.
*** This bug has been marked as a duplicate of 33577 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•