isuben
<!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>

 

分类:

技术点:

相关文章:

  • 2021-11-04
  • 2021-09-20
  • 2021-12-23
  • 2021-10-03
  • 2021-11-06
  • 2021-12-10
  • 2021-11-01
  • 2021-04-12
猜你喜欢
  • 2021-11-06
  • 2021-11-06
  • 2021-11-06
  • 2021-11-01
  • 2021-11-04
  • 2021-10-03
相关资源
相似解决方案