Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Nuestros voluntarios aún no han traducido este artículo al Español. Únete a nosotros y ayúdanos a traducirlo

The HTMLFormElement.elements property returns an HTMLFormControlsCollection (HTML 4 HTMLCollection) of all the form controls contained in the FORM element, with the exception of input elements which have a type attribute of image.

You can access a particular element by using either an index or the element name or id.

Syntax

nodeList = HTMLFormElement.elements

Example

var inputs = document.getElementById("form1").elements;
var inputByIndex = inputs[2];
var inputByName = inputs["login"];

Specifications

Specification Status Comment
WHATWG HTML Living Standard
The definition of 'HTMLFormElement.elements' in that specification.
Living Standard  
Document Object Model (DOM) Level 2 HTML Specification
The definition of 'HTMLFormElement.elements' in that specification.
Recommendation Initial definition

Etiquetas y colaboradores del documento

 Última actualización por: cvrebert,