<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>乘法口诀表-for循环</title>
</head>
<body>
<script>
for(var i=1;i<=9;i++){
for(var b=1,str="";b<=i;b++){
str+=b+"x"+i+"="+(b*i)+" ";
}console.log(str);
}
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>乘法口诀表-for循环</title>
</head>
<body>
<script>
for(var i=1;i<=9;i++){
for(var b=1,str="";b<=i;b++){
str+=b+"x"+i+"="+(b*i)+" ";
}console.log(str);
}
</script>
</body>
</html>