<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>js do while</title> </head> <body> <button οnclick="f()">do while</button> <p id="demo"></p> <script> /*参考:https://www.runoob.com/jsref/jsref-dowhile.html*/ function f() { let x = "", i = 0; do { x += i + "<br>"; i++; } while (i < 5); document.getElementById("demo").innerHTML = x; } </script> </body> </html>
js do while.html
最新推荐文章于 2023-04-08 13:28:34 发布