HTML DOM Form Object
Form Object
Form object represents an HTML form.
In an HTML document <form> Each occurrence, Form object is created.
Users typically forms used to collect user data, including the input elements such as: text fields, check boxes, radio buttons, submit buttons wait. Forms can also be said the Options menu, textarea, fieldset, legend, and label elements.
Forms are used to send data to the server.
Form objects collected
W3C: W3C standards.
集合 | 描述 | W3C |
---|---|---|
elements[] | 包含表单中所有元素的数组。 | Yes |
Form Object Properties
属性 | 描述 | W3C |
---|---|---|
acceptCharset | 服务器可接受的字符集。 | Yes |
action | 设置或返回表单的 action 属性。 | Yes |
enctype | 设置或返回表单用来编码内容的 MIME 类型。 | Yes |
length | 返回表单中的元素数目。 | Yes |
method | 设置或返回将数据发送到服务器的 HTTP 方法。 | Yes |
name | 设置或返回表单的名称。 | Yes |
target | 设置或返回表单提交结果的 Frame 或 Window 名。 | Yes |
Form Object
方法 | 描述 | W3C |
---|---|---|
reset() | 重置一个表单 | Yes |
submit() | 提交一个表单 | Yes |
Form object event
事件 | 描述 | W3C |
---|---|---|
onreset | 在重置表单元素之前调用。 | Yes |
onsubmit | 在提交表单之前调用。 | Yes |
Standard properties and events
Form object also supports the standard attributes and events .