while做99乘法表
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
let i = 1
while(i<10){
var j=1
while(j<=i){
document.write(`${j} * ${i}=${i * j}`)
j++
}
i++
document.write(`<br/>`)
}
</script>
</body>
</html>
for做99乘法表
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
for(let i=1;i<10; i++){
for(let j=1;j<=i;j++)
{
document.write(`${j} * ${i}=${i * j}`)
}
document.write(`<br/>`)
}
</script>
</body>
</html>