js動態給一個DIV插入一個表格

<div id="insertdiv">abc</div>
<script language="javascript">
<!--
insertdiv.innerText="";
var table1=document.createElement("<table border=1 width=500 bgcolor=black>");
table1.insertRow().insertCell().innerText="aaaaaaaaaaaaaaaa";
alert(table1.tagName);
document.getElementById("insertdiv").appendChild(table1);
//-->
</script>

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章