Insert a cell with javascript and then insert checkboxes into it? -


i want create table javascript, , in of cells, put in radiobuttons , checkboxes javascript. found code:

function insrow() {         var x = document.getelementbyid('mytable').insertrow(0);         var y = x.insertcell(0);         y.setattribute('id', "newdiv"); } 

(the last line (setattribute) line added. thought give new table cell id, , use document.getelementbyid id in various subroutines. not work. maybe making global variable store copy of 'y' in work - use in routines. shouldn't above code work?

the document.getelementbyid method (lowercase "g" , "d") work once element added dom.

ultimately, if possible, manipulations y variable, before it's appended, accessible id other element.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -