最近评论
正在载入评论列表...
![]() |
![]() |
|
![]()
for(i=0;i<=10;i++){
sum+=i;
|
i为用于控制重复执行次数的变量。

<html>
<head>
<title>重复执行(for)</title>
</head>
<body>
<script language="javascript">
<!--
|
for(i=1;i<=10;i++){
|
}
document.write("从1加到10的结果为:",sum);
//-->
</script>
</body>
</html>

图1.18