JavaScript for循环打印九九口诀表


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span {
            display: inline-block;
            width: 100px;
            height: 30px;
            line-height: 30px;
        }
    </style>
</head>
<body>
    <script>
        for (var m = 1; m <= 9; m++) {
            for (var i = 1; i <= m; i++) {
                document.write("<span>" + i + " * " + m + " = " + m*i + "</span>")
            }
            document.write("<br>")
        }
    </script>
</body>
</html>



扫描二维码,在手机上阅读

JavaScript双11倒计时小案例

CSS旋转折扇小案例

评 论
更换验证码