This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

forms

Summary

This property returns an object array representing an HTMLCollection of all the forms in the document.

Property of dom/Documentdom/Document

Syntax

Note: This property is read-only.

var HTMLCollection = document.forms;

Return Value

Returns an object of type DOM NodeDOM Node

Returns a collection of all the forms of a document

Examples

//retrieve forms collection and report how many forms are in the document
function numForms() {
  var allForms = document.forms;
  alert(allForms.length);
}

Related specifications

DOM Level 2 HTML
Recommendation

Attributions