hi guys....can anybody tell me what is the problem with the following line?....it works in Firefox but doesn't work in IE !
doc.getElementB yId("testbody") .innerHTML="";
doc.getElementB yId("testbody") .innerHTML="";
function createTable(id){
var hmrc=0;
var h=0;
var newrow;
var tbl;
var newcol , newinput;
var loopcounter=0;
tbl = doc.getElementById('testbody');
//create a new row
newrow = doc.createElement("TR");
newcol = doc.createElement("TD");
newcol.width = 200;
newinput = doc.createElement("input");
newinput.name = "head";
newcol.appendChild(newinput);
newrow.appendChild(newcol);
while ( loopcounter<x ){
newcol = doc.createElement("TD");
newcol.width = 200;
newinput = doc.createElement("input");
newinput.name = "newrow1table"+__uid1;
newinput.size = 20;
newinput.value = col1[loopcounter+1];
newcol.appendChild(newinput);
newrow.appendChild(newcol);
loopcounter++;
}
tbl.appendChild(newrow);
__uid1++;
loopcounter=0;
newrow = doc.createElement("TR");
newcol = doc.createElement("TD");
newcol.width = 200;
newinput = doc.createElement("input");
newinput.name = "head";
newcol.appendChild(newinput);
newrow.appendChild(newcol);
while ( loopcounter<x ){
newcol = doc.createElement("TD");
newcol.width = 200;
newinput = doc.createElement("input");
newinput.name = "newrow2table"+__uid1;
newinput.size = 20;
newinput.value = col2[loopcounter+1];
newcol.appendChild(newinput);
newrow.appendChild(newcol);
loopcounter++;
}
tbl.appendChild(newrow);
__uid1++;
h=parseInt (doc.newtable.hmr.value);
//alert(h);
hmrc++;
while (hmrc<=h){
loopcounter=0;
newrow = doc.createElement("TR");
newcol = doc.createElement("TD");
newcol.width = 200;
newinput = doc.createElement("input");
newinput.name = "head"+hmrc;
newinput.value= "test"+hmrc;
newcol.appendChild(newinput);
newrow.appendChild(newcol);
while ( loopcounter<x ){
newcol = doc.createElement("TD");
newcol.width = 200;
newinput = doc.createElement("input");
newinput.name = "env"+loopcounter;
newinput.size = 20;
newinput.value = "";
newcol.appendChild(newinput);
newrow.appendChild(newcol);
loopcounter++;
}
tbl.appendChild(newrow);
hmrc++;
}
}
</script>
<form >
<body>
<tbody ID="testbody">
</tbody>
</body>
<input type=button onclick = function ())
</form>
<input type="button" onclick="YourJavascriptFunction()" />
Comment