亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JavaScript while ??

while ??

while ??? ??? ??? true? ?? ?? ??? ?????.

Syntax

while(??)
{
??? ??
}

?

? ??? ??? ?? i? ? ?? ? ?? ?????. 10??:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<p>點(diǎn)擊下面的按鈕,只要 i 小于 5 就一直循環(huán)代碼塊。</p>
<button onclick="myFunction()">點(diǎn)擊這里</button>
<p id="demo"></p>
<script>
function myFunction(){
var x="",i=0;
while (i<5){
x=x + "該數(shù)字為 " + i + "<br>";
i++;
}
document.getElementById("demo").innerHTML=x;
}
</script>
</body>
</html>

NOTE: ??? ??? ??? ?? ????? ?? ?? ?? ??? ??? ????. ?? ?? ????? ??? ? ????.

????? ???? ??? ???


do/while ??

do/while ??? while ??? ?????. ??? ??? ??? ???? ?? ?? ??? ? ? ??? ??, ??? ??? ??? ?????.

Syntax

do
{
??? ??
}
while(??);

??

?? ???? do/while ??? ?????. ??? ??? ????? ?? ?? ??? ???? ??? ??? ?????? ? ? ?????.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<p>點(diǎn)擊下面的按鈕,只要 i 小于 5 就一直循環(huán)代碼塊。</p>
<button onclick="myFunction()">點(diǎn)擊這里</button>
<p id="demo"></p>
<script>
function myFunction(){
var x="",i=0;
do{
x=x + "該數(shù)字為 " + i + "<br>";
   i++;
}
while (i<5)  
document.getElementById("demo").innerHTML=x;
}
</script>
</body>
</html>

????? ???? ??? ???



???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <body> <p>點(diǎn)擊下面的按鈕,只要 i 小于 10 就一直循環(huán)代碼塊。</p> <button onclick="myFunction()">點(diǎn)擊這里</button> <p id="demo"></p> <script> function myFunction(){ var x="",i=0; while (i<10){ x=x + "該數(shù)字為 " + i + "<br>"; i++; } document.getElementById("demo").innerHTML=x; } </script> </body> </html>