ภาพรวม
แบบฟอร์มส่งคืนคอลเลกชัน (วัตถุ HTMLCollection) ที่มีองค์ประกอบแบบฟอร์มทั้งหมดในเอกสารปัจจุบัน
ไวยากรณ์
var collection = document.forms;
ตัวอย่าง
รับข้อมูลแบบฟอร์ม
<script type = "text/javascript"> $ (function () {var thisform = document.forms ['form1']; // รับแบบฟอร์มที่มีชื่อ Form1 // หรือ // var fisform = document.forms [0]; console.info (fisform.address.value); document.forms [0] .submit (); value = "beijing"/> </form> <form action = "x" name = "form2"> </form> <form action = "x" name = "form3"> </form> </body>