请问如何获得数组的长度?

在一个页面的form1中,如果有一组同名(例如名字都为name)的text,请问我如何得到docement.from1.name的长度啊?我用了document.form1.name.length不行哦!
---------------------------------------------------------------

1<script language="JavaScript">   
2function check(){   
3alert(document.from1.name.length);   
4}   
5</script>
1<form method="post" name="from1" onsubmit="return check();">
2<input id="name" name="name" type="text"/>
3<input id="name" name="name" type="text"/>
4<input id="name" name="name" type="text"/>
5<input name="Submit" type="submit" value="提交"/>
6</form>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus