<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
span {
display: inline-block;
width: 100px;
height: 30px;
}
</style>
</head>
<body>
<script>
function test() {
for (var m = 1; m <= 9; m++) {
for (var i = 1; i <= m; i++) {
document.write("<span>" + m + "*" + i + "=" + m * i + "</span>")
}
document.write("<br>")
}
}
// 想显示几遍就调用几遍
test()
test()
</script>
</body>
</html>
想显示几遍就调用几遍