zqld
 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>99乘法表</title>
 6 </head>
 7 <body>
 8 <script type="text/javascript">
 9     var i=1;
10     while(i <= 9){
11         var j=1;//每次都需重置j的值
12         while(j <= i){
13             document.write(j+"*"+i+"="+(i*j)+"&nbsp;");
14             j++;
15         }
16         i++;
17         document.write("<br>")
18     }
19 </script>
20 </body>
21 </html>


 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>99乘法表</title>
 6 </head>
 7 <body>
 8 <script type="text/javascript">
 9     for(var i=1; i<=9; i++)
10     {
11         for(var j=1; j<=i;j++)//j<=i
12         {
13             document.write(i+"*"+j+"="+(i*j)+"&nbsp;");
14         }
15         document.write("<br>");
16     }
17     document.write("<br>");
18    
19 </script>
20 </body>
21 </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
相关资源
相似解决方案