<html>
<head></head>
<body>
<form name="fm1" id="fm1">
name:<input type="text" name="name" id="name1" />
<input type="submit" id="s1"/>
</form>
<form name="fm2" id="fm2">
name:<input type="text" name="name" id="name2" />
<input type="submit" id="s2" />
</form>
<script type="text/javascript">
//var form = document.getElementById('fm2');
//var formarray = document.forms[1];//得到页面中所以表单的数组
//var form = document.forms['fm1'];//根据表单name属性得到数组
var form = document.fm1;//根据表单name属性得到数组
alert(form);
</script>
</body>
</html>