Insert a cell with javascript and then insert checkboxes into it?
<p>I want to create a table with javascript, and in some of the cells, put in radiobuttons and checkboxes with javascript.
I found this code:</p>

<pre><code>function insRow() {
        var x = document.getElementById('myTable').insertRow(0);
        var y = x.insertCell(0);
        y.setAttribute('id', "NewDiv");
}
</code></pre>

<p>(the last line (<code>setAttribute</code>) is a line that I added.  I thought that I could give the new table cell an ID, and then use <code>document.GetElementByID</code> with that ID in various subroutines.  That does not work.  Now maybe making a global variable to store a copy of 'y' in would work - I could use it in the routines.  But shouldn't the above code also work?</p>
