×
参考手册概览

JavaScript 对象

JavaScript Array 对象手册 JavaScript Array 对象JavaScript Boolean 对象JavaScript Date 对象JavaScript Math 对象JavaScript Number 对象JavaScript String 对象JavaScript RegExp 对象JavaScript 全局属性/函数JavaScript 运算符

Browser 对象

Window 对象Navigator 对象Screen 对象History 对象Location 对象

DOM 对象

HTML DOM DocumentHTML DOM 元素对象HTML DOM 属性对象HTML DOM 事件对象

HTML 对象

<a><area><audio><base><blockquote><body><button><canvas><col><colgroup><datalist><del><details><dialog><embed><fieldset><form><iframe><frameset ><img><ins><input> - button<input> - checkbox<input> - color<input> - date<input> - datetime<input> - datetime-local<input> - email<input> - file<input> - hidden<input> - image<input> - month<input> - number<input> - range<input> - password<input> - radio<input> - reset<input> - search<input> - submit<input> - text<input> - time<input> - url<input> - week<keygen><link><label><legend><li><map><menu><menuItem><meta><meter><object><ol><optgroup><option><param><progress><q><script><select><source><style><table><td><th><tr><textarea><title><time><track><video>

HTML DOM Password 对象


Password 对象

Password 对象代表 HTML 表单中的密码字段。

HTML 的 <input type="password"> 标签在表单上每出现一次,一个 Password 对象就会被创建。

该文本输入字段供用户输入某些敏感的数据,比如密码等。当用户输入的时候,他的输入是被掩盖的(例如使用星号*),以防止旁边的人从他背后看到输入的内容。不过需要注意的是,当表单提交时,输入是用明文发送的。

与类型为 "text" 的元素类似,当用户改变显示值时,它会触发 onchange 事件句柄。

您可以通过遍历表单的 elements[] array 来访问密码字段,或者通过使用 document.getElementById() 。


Password 对象属性

W3C: W3C 标准。

属性 描述 W3C
defaultValue 设置或返回密码字段的默认值。 Yes
disabled 设置或返回是否应被禁用密码字段。 Yes
form 返回对包含此密码字段的表单的引用。 Yes
maxLength 设置或返回密码字段中字符的最大数目。 Yes
name 设置或返回密码字段的名称。 Yes
readOnly 设置或返回密码字段是否应当是只读的。 Yes
size 设置或返回密码字段的长度。 Yes
type 返回密码字段的表单元素类型。 Yes
value 设置或返回密码字段的 value 属性的值。 Yes

Password 对象方法

方法 描述 W3C
select() 选取密码字段中的文本。 Yes

标准属性和事件

Password 对象同样支持标准的 属性事件


分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)