js实现两种99乘法表

2022-10-17,,

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>99乘法表</title>
</head>
<body>
<script type="text/javascript">
var i=1;
while(i <= 9){
var j=1;//每次都需重置j的值
while(j <= i){
document.write(j+"*"+i+"="+(i*j)+"&nbsp;");
j++;
}
i++;
document.write("<br>")
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>99乘法表</title>
</head>
<body>
<script type="text/javascript">
for(var i=1; i<=9; i++)
{
for(var j=1; j<=i;j++)//j<=i
{
document.write(i+"*"+j+"="+(i*j)+"&nbsp;");
}
document.write("<br>");
}
document.write("<br>"); </script>
</body>
</html>

js实现两种99乘法表的相关教程结束。

《js实现两种99乘法表.doc》

下载本文的Word格式文档,以方便收藏与打印。