
HELP: InsertAdjacentHTML Problem
Hi,
I have a program that should add a new row to a table based on a user
selecting a checkbox and it does not work. Anytime the "InsertAdjacentHTML"
command is run by the browser, IE4 gives me a "Invalid Target Element for
this Operation". Here's the code that causes the problem:
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=VBScript>
<!--
Sub chkContents_onclick
if MyCheckBox.checked = true then
MyTable.insertAdjacentHTML "BeforeEnd", "<tr><td>Hello</td></tr>"
end if
End Sub
-->
</SCRIPT>
The table exists and has two rows and one column already. The table is not
in a form and for test purposes, it's the only other object in the HTML
document.
Shouldn't the above code work?
Thanks for your help,
-Bill
--
(Response by e-mail appreciated.)