<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>