]<script>
//建一个row行,col列的表格
var tbl, tbody, tr, td, text, i,j,row,col;
row=10;col=15;
var theDoc = document;
var theBody = theDoc.body;
tbl = theDoc.createElement("TABLE");
tbl.border = "1";
tbl.setAttribute("id","abc");
tbody = theDoc.createElement("TBODY");
tbl.insertBefore(tbody, null);
theBody.insertBefore(tbl, null);
for (i=0; i<row; i++) {
tr = theDoc.createElement("TR");
for (j=0;j<col;j++)
{
td = theDoc.createElement("TD");
text = theDoc.createTextNode("Text");
tbody.insertBefore(tr, null);
tr.insertBefore(td, null);
td.insertBefore(text, null);
}
}
var a="aaa";
var b="bbb";
document.getElementById("abc").attachEvent("onclick",function(){alert(a);alert(b)});
</script>