19 September 2008

IE innerHTML - "Unknown runtime error"

"Unknown runtime error" -- only in IE. Occur when click 'innerHTML WITH form tag'

<div id="replaceme"></div>
<div onclick="replace();return false;">innerHTML WITHOUT form tag</div><br/>
<div onclick="replace2();return false;">innerHTML WITH form tag</div>
function replace() {
document.getElementById('replaceme').innerHTML = 'REPLACED';
function replace2() {
document.getElementById('replaceme').innerHTML = '<form>REPLACED form</form>';

innerHTML supposed to supported on all major browser, http://www.quirksmode.org/dom/innerhtml.html

Current solution, don't wrap the #replaceme div in form tag
Post a Comment