DOM Input Password 对象

Password 对象

The Password object represents a password field in an HTML form. For each instance of an HTML <input type="password"> tag on a form, a Password object is created.
当HTML表单中含有<input type="password">标签就意味着Password对象建立起来了

You can access a Password object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().
你可以根据表单的元素组索引数或名称来访问Password对象,也可以使用getElementById()来访问

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

Password 对象属性

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 password field
设置或返回可以访问password field的键盘按键。
4  Yes
defaultValueSets or returns the initial value of the password field
设置或返回password field的初始值
312Yes
disabledSets or returns whether or not the password field should be disabled
设置或返回password field是否可用
516Yes
formReturns a reference to the password field's parent form
返回password field的父表参考
312Yes
idSets or returns the id of the password field (In IE 4 this property is read-only)
设置或返回password field的id
41 No
maxLengthSets or returns the maximum number of characters the user can enter in the password field
设置后返回password field里可输入的最大限度字符数
416Yes
nameSets or returns the name of the password field
设置或返回password field的name
312Yes
readOnlySets or returns whether the content of the password field is read-only
设置或返回password field里的内容为只读
416Yes
sizeSets or returns the size of the password field
设置或返回password field的大小
316Yes
tabIndexSets or returns the index that defines the tab order for the password field
设置或返回password field的tab顺序
4  Yes
typeThe type of the form element. For a password object it will always be "password"
表单元素类型。password 对象就显示为"password"
313Yes
valueSets or returns the value of the value attribute of the password field
设置或返回password field的value属性值
312Yes

Password 对象方法

Method
方法
Description
描述
IEFNW3C
blur()Removes focus from the password field
取消对password field的聚焦
412Yes
click()Simulates a mouse-click on the password field
模拟鼠标点击password field
41 No
focus()Sets focus on the password field
让password field获得聚焦
312Yes
select()Selects and highlights the entire text that is in the password field
选中password field里的文字并且显示高亮
412Yes

Password 对象事件

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

Event
事件
Description
描述
IEFNW3C
onBlurExecutes some code when the password field loses focus
当password field失去聚焦的时候执行代码
412 
onClickExecutes some code when the user clicks in the password field
当用户点击password field的时候执行代码
4   
onFocusExecutes some code when the password field gets focus
当password field得到聚焦的时候执行一些代码
312 
onKeyDownExecutes some code when a key is pressed down in the password field
当在password field中按住某键的时候执行代码
414 
onKeyPressExecutes some code when an alphanumeric key is pressed in the password field
当在password field中按下并释放某键的时候执行一些代码
414 
onKeyUpExecutes some code when a key is released in the password field
当在password field中释放某键的时候执行一些代码
414 
onSelectStartExecutes some code when some text in the password field is selected
当password field中的文字选中时执行一些代码
4   
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值