Posted By: Pat (Gotroch) on 'CZwww'
Title: IE appendChild
Date: Fri Apr 21 17:11:40 2006
Cau, mam nize uvedeny kod, mel by pridat do tabulky z id myTable novy radek s
5 cells. Bohuzel funguje jenom ve FF a opere.
Proc to nejede v IE? Mam pocit, ze je to uplne normalni kus kodu...
<script>
var aktCols,aktRows;
var table;
function createCell(text){
cell = document.createElement('td');
cell.appendChild(document.createTextNode(text));
return cell;
}
function createRow(cntCells){
row = document.createElement('tr');
for(i=0;i<cntCells;i++){
cell = createCell('test');
row.appendChild(cell);
}
return row;
}
function updateTable(){
aktCols = document.forms['setFrm'].aktCols.value;
aktRows = document.forms['setFrm'].aktRows.value;
table = document.getElementById('myTable');
row = createRow(5);
table.appendChild(row);
x = table.getElementsByTagName('tr')[0];
}
</script>~
Hey.
You give it all, butt I want more!