DOM Input File

FileUpload 对象

For each instance of an <input type="file"> tag in an HTML form, a FileUpload object is created.
HTML表单中出现<input type="file">标签就意味着FileUpload对象建立起来了

You can access a FileUpload object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().
你可以通过元素数组索引或是用getElementById()来访问FileUpload对象

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

FileUpload 对象属性

Property
属性
Description
描述
IE FNW3C
acceptSets or returns a list of content types, which the server processing this form will handle correctly
设置或返回内容类型列表,服务器可更准确的处理表单
-  Yes
accessKeySets or returns the keyboard key to access the FileUpload object
设置或返回可访问FileUpload对象的按键
4  Yes
alignSets or returns the alignment of the FileUpload object according to the surrounding text
设置或返回FileUpload对象相对于周围文字的对齐方式
-  Yes
altSets or returns an alternate text to display if the browser does not support <input type="file">
设置或返回替换显示的文字,针对那些无法支持<input type="file">的浏览器
-  Yes
defaultValueSets or returns the initial value of the FileUpload object
设置或返回FileUpload对象的初始值
413Yes
disabledSets or returns whether or not the FileUpload object should be disabled
设置或返回FileUpload对象是否可用
4  Yes
formReturns a reference to the form that contains the FileUpload object
返回包含FileUpload对象的表单参考
413Yes
idSets or returns the id of the FileUpload object (In IE 4 this property is read-only)
设置或返回FIleUpload对象的id
41 No
nameSets or returns the name of the FileUpload object
设置或返回FileUpload对象的name
413Yes
tabIndexSets or returns the index that defines the tab order for the FileUpload object
设置或返回FileUpload对象的tab顺序
4  Yes
typeReturns the type of the form element. For a FileUpload object it will be "file"
返回表单元素类型,FileUpload对象就返回"file"
413Yes
valueReturns the file name of the FileUpload object after the text is set by user input
返回FileUpload对象在用户输入后的文件名称
413Yes

FileUpload 对象方法

Method
方法
Description
描述
IEFNW3C
blur()Removes focus from the FileUpload object
取消对FileUpload对象的聚焦
413Yes
click()Simulates a mouse-click on the FileUpload object
模仿鼠标点击FileUpload对象
4  No
focus()Gives focus to the FileUpload object
让FileUpload对象获得聚焦
413Yes
select()Selects the FileUpload object
选择FileUpload对象
4  Yes

FileUpload 对象事件

Syntax: object.event_name="someJavaScriptCode"
语法:对象.事件名称="一些JS代码"

Event
事件
Description
描述
IEFNW3C
onBlurExecutes some code when the FileUpload object loses focus
当FileUpload对象失去聚焦的时候执行代码
413 
onClickExecutes some code when the FileUpload object gets a mouse click
当FileUpload对象被鼠标点击的时候执行代码
413 
onFocusExecutes some code when the FileUpload object gets focus
当FileUpload对象获得聚焦的时候执行代码
413 
onSelectStartExecutes some code when the FileUpload object gets selected
当FileUpload对象被选中的时候执行代码
4   
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值