<!DOCTYPE html> <!--Javascript语法-循环语句while循环--> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <!--while循环--> <script> var i =1; while(i<10){ document.write("i的值"+i+"<br/>"); i++; } </script> <!-- do while循环--> <script> var j =1; do{ document.write("j的值"+j+"<br/>"); j++; } while(j<10); // while先判断在循环,do...while先循环再判断 </script> </body> </html>
JavaScript基础----09Javascript语法-循环语句while循环
最新推荐文章于 2020-05-29 13:29:36 发布