日期:2014-05-16  浏览次数:20279 次

数组不是从0开始的吗?请看一下代码。。
数组不是从0开始的吗?请看一下代码。。

JScript code
<script type="text/javascript">
function checkFour()
{
var index = 0;
while (index < 1)
{
window.document.the_form.elements[index].checked = true;
index = index + 1;
}
}
</script>
</head>

<body>
<form name="the_form">
<input type="checkbox" />1 
<input type="checkbox" />2 
<input type="button" onClick="checkFour();" />
</form>


------解决方案--------------------
这么明显的问题也看不出来?