<html>
<head>
<title>javascript通过for循环制作table,点击table中的数字弹出包含对应数字的窗口</title>
</head>
<body>
<script>
document.write("<table width=500 border=1>")
var b=1;
for( i = 0 ; i < 3 ; i++)
{
document.write("<tr>")
for( j = 0 ;j < 3 ; j++ )
{
document.write("<td type='button' onclick=aaa("+b+")>"+b+++"</td>")
}
document.write("</tr>")
}
document.write("</table>")
function aaa(b)
{
alert(b)
}
</script>
</body>
</html>