HELP: InsertAdjacentHTML Problem 
Author Message
 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.)



Sat, 24 Feb 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. insertAdjacentHTML

2. VB6 : insertAdjacentHTML

3. write script into another frame with innerHTML/insertAdjacentHTML

4. insertAdjacentHTML and removeChild

5. insertAdjacentHTML Questions...

6. insertadjacenthtml of object to trigger autodownload...

7. insertAdjacentHTML Method

8. insertAdjacentHTML

9. Invalid target element for this operation / insertAdjacentHTML

10. Cross Browser insertAdjacentHTML() ??

11. using asp var in "insertAdjacentHtml"

12. help help help help help

 

 
Powered by phpBB® Forum Software