反反复复(while循环)
任务
我们使用while语句,输出5个数字。补充第8行代码。
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>while</title> <script type="text/javascript"> var mynum =1;//mynum初值化数值为1 while(mynum<=5) { document.write("数字:"+mynum); mynum=mynum+1; } </script> </head> <body> </body> </html>