Form 对象代表一个 HTML <form> 元素。
您可以使用 getElementById() 访问 <form> 元素:
提示:您还可以使用以下方式访问 <form> 元素形式收藏。
您可以使用 document.createElement() 方法创建 <form> 元素:
Collection | Description |
---|---|
elements | Returns a collection of all elements in a form |
Property | Description |
---|---|
acceptCharset | Sets or returns the value of the accept-charset attribute in a form |
action | Sets or returns the value of the action attribute in a form |
autocomplete | Sets or returns the value of the autocomplete attribute in a form |
encoding | Alias of enctype |
enctype | Sets or returns the value of the enctype attribute in a form |
length | Returns the number of elements in a form |
method | Sets or returns the value of the method attribute in a form |
name | Sets or returns the value of the name attribute in a form |
noValidate | Sets or returns whether the form-data should be validated or not, on submission |
target | Sets or returns the value of the target attribute in a form |
Method | Description |
---|---|
reset() | Resets a form |
submit() | Submits a form |
HTML 教程:HTML 表单
JavaScript 教程:JS 表单/验证
HTML 参考:HTML <表单> 标签
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!