js for和while两种99乘法表
<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)+" "); } document.write("<br>"); } document.write("<br>"); </script>
<script type="text/javascript"> var i=1,j; while(i<=9){ j=1; while(j<=i){ document.write(i+"*"+j+"="+(i*j)+" "); j++; } i++; document.write("<br>") } </script>