概要
フォームは、現在のドキュメントにすべてのフォーム要素を含むコレクション(HTMLCollectionオブジェクト)を返します。
文法
var collection = document.forms;
例
フォーム情報を取得します
<script type = "text/javascript"> $(function(){var thisform = document.forms ['form1']; // form form1 // // var thisform = document.forms [0]; // form console.info(thisform.username.value); console.info(thisform.address.value); forms [0] .submit(); value = "beijing"/> </form> <form action = "x" name = "form2"> </form> <form action = "x" name = "form3"> </form> </body>