<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>do...while</title>
<script type="text/javascript">
var mynum =1;//mynum初值化数值为6
do
{
document.write("数字:"+mynum+"<br/>");
mynum++;
}
while(myunm<=5 )
</script>
</head>
<body>
</body>
</html>
while(myunm<=5 )
这段代码写错了所以循环不了,所以输出的是最初的结果:var mynum =1;
while(myunm<=5 )
这里变量名错了,应该是mynum
它不会等于1的,只有你写错的可能,这句你改下看看while(mynum<=5)