怎样在在HTML中动态加本页面一个3行3列的表格
怎样在在HTML中动态加本页面一个3行3列的表格.要求保留本页面以前的内容!
[解决办法]
<HTML>
<HEAD>
<SCRIPT LANGUAGE= "JavaScript ">
function inserttable () {
var objdiv = document.getElementById( "tablediv ");
objdiv.innerHTML= " <table border=1 style= 'border: 1px ccc
solid; '> <tr> <td> 1 </td> <td> 2 </td> <td> 3 </td> </tr> <tr> <td> 1 </td> <td> 2 </td> <td> 3 </td> </tr> <tr> <td> 1 </td> <td> 2 </td> <td> 3 </td> </
tr> </table> ";
};
</SCRIPT>
</HEAD>
<BODY>
here is the old html web page content.
<input type= "button " onclick= "inserttable(); " value= "Insert table ">
<div id= "tablediv "> </div>
</BODY>
</HTML>