HTMLFormElement : HTMLElement
Return to: HTML DOM Level 5 index

Defines a clickable button element.

Platform Support

Mozilla Chrome Safari Opera IE Netscape
1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+

Constructors

Constructor Action Mozilla Chrome Safari Opera IE Netscape
HTMLFormElement Constructor() : HTMLFormElement
Creates an instance of the HTMLFormElement.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+

HTMLFormElement() : HTMLFormElement

Creates an instance of the HTMLFormElement.

Returns
HTMLFormElement

Visibility
internal

Properties

Property Action Mozilla Chrome Safari Opera IE Netscape
acceptCharset : String
Gives the character encodings that are to be used for the submission.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

action : String
Specifies the action attribute of the form element.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

autocomplete : String
Specifies the autocomplete attribute of the form element.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

enctype : String
Specifies the encoded type of the form element.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

method : String
Specifies the method for the form (GET, POST, PUT, DELETE)
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

name : String
Specifies the name of the form.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

noValidate : Boolean
Specifies whether form is validated during submission.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

target : String
Specifies the target for the form.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

elements : HTMLFormControlsCollection
An HTMLFormControlsCollection rooted at the Document node, whose filter matches listed elements whose form owner is the form element, with the exception of input elements whose type attribute is in the Image Button state.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

length : Number
Specifies the number of nodes represented by the elements collection.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

Inherited Functions

Method Action Mozilla Chrome Safari Opera IE Netscape
getElementsByClassName(String classNames) : NodeList
Returns a NodeList containing all the Element nodes with the specified classNames.
Show Details 1.9+ 5.0+ 3.1+ 9.51+ no no

Parameters
String classNames (one-or-more)A string representing the class name(s) of the elements to return. Multiple class names should be separated by spaces.

Returns
NodeList

Using getElementsByClassName

                        	                    document.getElementById("useCases").getElementsByClassName("question");

Would return a NodeList of all elements inside the element with the id "useCases" to which the class "question" applies.

                        	                    document.getElementById("useCases").getElementsByClassName("question issue");

Would return a NodeList of all elements inside the element with the id "useCases" to which both the classes "question" and "issue" apply.

Remarks

Returns a list of child elements to which the specified className applies. The returned NodeList is sorted in tree order (the order the elements were found during a depth-first preorder traversal through the node tree).

See Also

Document.getElementsByClassName|Element.getElementsByClassName|HTMLDocument.getElementsByClassName

Availability

HTML 5|W3C|W3C

Functions

Method Action Mozilla Chrome Safari Opera IE Netscape
item(Number index) : void
Returns the indexth element in the form.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+

Parameters
Number index The value of index.

Availability

WhatWG

namedItem(String name) : void
Returns the form control in the form with the given ID or name.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+

Parameters
String name The name of the item.

Availability

WhatWG

submit() : void
Submits the form element from the form element itself, with the scripted-submit flag set.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

reset() : void
Resets the form element.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

checkValidity() : Boolean
The user agent must instanceally validate the constraints of the form element, and return true if the constraint validation return a positive result, and false if it returned a negative result.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+

Returns
Boolean

Availability

WhatWG

When invoked, the user agent must broadcast forminput events from the form element.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

When invoked, the user agent must broadcast formchange events from the form element.
Show Details 1.0+ 5.0+ 1.0+ 5.0+ 4.0+ 6.0+
Availability

WhatWG

References

HTMLFormElement

Availability

JavaScript 1.2|WhatWG

text_javascript aptana_docs