DOM Form 对象

Form Object
表单对象

The Form object represents an HTML form. For each instance of an HTML <form> tag in a document, a Form object is created.
表单对象代表一个HTML表单。HTML中一有<form>标签,一个表单对象就被建立了。

Forms are used to prompt users for input. The input data is normally posted to a server for processing.
表单被用来提示用户输入。输入的数据一般被发送到服务器上做处理

IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).

Form Object Collections表单对象集合

Collection
集合
Description
描述
IE FNW3C
elements[]Returns an array containing each element in the form
返回包含表单中每个元素的数组
312Yes

Form Object Properties表单对象属性

Property
属性
Description
描述
IE FNW3C
acceptCharsetSets or returns a list of character encodings for form data that must be accepted by the server processing the form
设置或获取处理表单的服务器必须接受的输入数据所用的字符编码方式列表。
3  Yes
actionSets or returns the URL of where the input data will be submitted
设置或返回将被提交的输入数据的URL
312Yes
encodingSets or returns the MIME encoding for the form312No
enctypeSets or returns the MIME encoding for the form
返回或设置表单的MIME编码
516Yes
idSets or returns the id of the form (In IE 4 this property is read-only)41 No
lengthReturns the number of elements in a form312Yes
methodSets or returns how form data is submitted to the server ("get" or "post")
设置或返回数据提交给服务器的方式("get"或 "post")
312Yes
nameSets or returns the name of a form
返回或设置表单的名称
5  No
targetSets or returns the target window or frame that responses are sent to after submission of a form
设置或获取目标内容要显示于哪个窗口或框架。
312Yes

Form Object Methods表单对象方法

MethodDescriptionIEFNW3C
reset()Resets the default values of all elements in the form (same as clicking the Reset button)
重置所有表单内元素为默认值
413Yes
submit()Submits the form (same as clicking the Submit button)
提交表单
312Yes

Form Object Events表单对象事件

Syntax: object.event_name="someJavaScriptCode"
语法: object.event_name="someJavaScriptCode"

EventDescriptionIEFNW3C
onResetExecutes some code when a Reset event occurs413 
onSubmitExecutes some code when a Submit event occurs312 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值