45 lines
756 B
HTML
45 lines
756 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<title>while</title>
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<script>
|
|
//var i = 10;
|
|
// while (i<10) {
|
|
// console.log(i);
|
|
// i++
|
|
// }
|
|
|
|
// do {
|
|
// console.log(i);
|
|
// i++
|
|
|
|
// } while (i<8);
|
|
|
|
// 使用 while 重写 99乘法表
|
|
// var i = 1, $99 = "";
|
|
// while (i< 10) {
|
|
// var j = 1;
|
|
// while(j<=i){ // j = 3
|
|
// $99 += j + 'x' + i + '=' + i*j + " ";
|
|
// j++
|
|
// }
|
|
// $99+= "<br/>"
|
|
// i++
|
|
// }
|
|
// document.write($99)
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |