Closed Bug 41479 Opened 25 years ago Closed 25 years ago

Problems with event in InnerHTML

Categories

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

defect

Tracking

()

VERIFIED DUPLICATE of bug 33577

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>
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
adding myself (should have done this with the last update, sorry)
Not sure what to do with this bug, this'll probably be fixed when bug 7997 is fixed...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Handing this one over to Tom.
Assignee: jst → joki
OS: Windows 98 → All
Hardware: PC → All
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
Verified Duplicate.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.