[thelist] adding HTML using the DOM

Tom Dell'Aringa pixelmech at yahoo.com
Mon Sep 16 12:56:00 CDT 2002

I'm appending a new row to a table using the DOM method. What I need
in one cell is to add a checkbox, so I need to add some HTML. I can
of course add text by using:

textVal = "string of text"
textNode = docTarget.createTextNode(textVal)

But if I try to put HTML in textVal, it merely writes it out as text.
My second thought was to set an id for the cell:


then use innerHTML to do it like:

document.getElementById('test55').innerHTML = "phooie";

Yet it tells me this is not a valid object. Either you can't set the
id as an attribute, or I'm doing something wrong here. Anyone have
any other ideas how to add the checkbox using the DOM?



var me = tom.pixelmech.webDeveloper();

[Making A Commercial Case for Adopting Web Standards]

Do you Yahoo!?
Yahoo! News - Today's headlines

More information about the thelist mailing list