判断,循环

 1 <html>
 2   <!--声明式:不能显示-->
 3   <head>
 4   <!--设置网页编码-->
 5   <meta charset="utf-8"/>
 6    <title> 我的标题 html</title>
 7   </head>
 8   <!--能够显示的内容-->
 9   <body>
10   <script>
11        //判断语句
12       /* var age=20;
13        document.write("你的年龄为:"+age);
14        if(age>18)
15        {
16            alert("成年啦");
17        }
18        else
19        {
20            alert("知道啦");
21        }*/
22        //循环语句
23        var count=1;
24        var limit=5;
25        while(count<=limit)
26        {
27            alert(count);
28            count++;
29        }
30        
31   </script>  
32   </body>
33  </html>

 

posted @ 2021-01-18 15:42  丁帅帅dss  阅读(57)  评论(0)    收藏  举报