Hi I am working with prototype. I am just a begginer. I tried to create a table dynamically with DOM in prototype. The code is working in Mozilla but not in IE. Any suggestions.
[HTML]<html>
<body>
<input type="button" id="myButton" value="Create Table">
<div id="myDiv">
</div>
</body>
</html>
<script src="prototype.js"></script>
<script type="text/javascript">
$('myButton').observe('click',function(){
var oTable = new Element('table',{style: "border: 2; cellspacing:5; cellpadding:5" });
var tBody = new Element('tbody',{});
var row = new Element('tr',{style: "background-color: lightblue" });
var xx = new Element('input',{name: "user", disabled: false });
var yy = new Element('input',{type: "radio", name: "raduser", disabled: false });
var zz = new Element('input',{type: "checkbox", name: "checkuser", disabled: false });
var zzz = new Element('input',{type:"checkbox", name: "user", value:"Checked"});
var tmp1 = new Element('td',{}).update(xx);
var tmp2 = new Element('td',{}).update(yy);
var tmp3 = new Element('td',{}).update(zz);
var tmp4 = new Element('td',{}).update(zzz);
row.insert(tmp1);
row.insert(tmp2);
row.insert(tmp3);
row.insert(tmp4);
tBody.insert(row);
oTable.insert(tBody);
$('myDiv').appendChild(oTable);
});
</script>[/HTML]
Regards
Ramanan Kalirajan