Easy Tutorial
❮ Met Element Removeattribute Prop Nav Useragent ❯

HTML DOM


Form Object

The Form object represents an HTML form.

Each time a <form> appears in the HTML document, a Form object is created.

Forms are typically used to collect user data and include elements such as text fields, checkboxes, radio buttons, submit buttons, and more. Forms can also contain elements like select menus, textareas, fieldsets, legends, and labels.

Forms are used to send data to the server.


Form Object Collections

W3C: W3C Standard.

Collection Description W3C
elements[] An array containing all elements in the form. Yes

Form Object Properties

Property Description W3C
acceptCharset The character sets that the server can accept. Yes
action Sets or returns the action attribute of the form. Yes
enctype Sets or returns the MIME type of the form content encoding. Yes
length Returns the number of elements in the form. Yes
method Sets or returns the HTTP method used to send data to the server. Yes
name Sets or returns the name of the form. Yes
target Sets or returns the frame or window name for form submission results. Yes

Form Object Methods

Method Description W3C
reset() Resets a form. Yes
submit() Submits a form. Yes

Form Object Events

Event Description W3C
onreset Called before the form elements are reset. Yes
onsubmit Called before the form is submitted. Yes

Standard Attributes and Events

The Form object also supports standard attributes and events.

❮ Met Element Removeattribute Prop Nav Useragent ❯