HTML DOM Input Password Obheto
- 上一頁 <input> number
- 下一頁 <input> radio
Objek Input Password
Ang Objek Input Password ay naglalarawan ng elemento HTML <input> na may type="password".
Pumunta sa Objek Input Password
Maaaring gamitin ang getElementById() upang pumunta sa elemento <input> na may type="password":
var x = document.getElementById("myPsw");
Paalala:Maaari mo ring hanapin ang form sa pamamagitan ng Koleksyon ng elements Upang pumunta sa <input type="password">.
Lumikha ng Objek Input Password
Maaaring gamitin ang methodong document.createElement() upang lumikha ng elemento <input> na may type="password":
var x = document.createElement("INPUT"); x.setAttribute("type", "password");
Input Password 對象屬性
屬性 | 描述 |
---|---|
autocomplete | 設置或返回密碼字段的 autocomplete 屬性值。 |
autofocus | 設置或返回頁面加載時密碼字段是否應自動獲得焦點。 |
defaultValue | 設置或返回密碼字段的默認值。 |
disabled | 設置或返回是否禁用密碼字段。 |
form | 返回對包含密碼字段的表單的引用。 |
maxLength | 設置或返回密碼字段的 maxlength 屬性值。 |
name | 設置或返回密碼字段的 name 屬性值。 |
pattern | 設置或返回密碼字段的 pattern 屬性值。 |
placeholder | 設置或返回密碼字段的 placeholder 屬性值。 |
readOnly | 設置或返回密碼字段是否為只讀。 |
required | 設置或返回在提交表單之前是否必須填写密碼字段。 |
size | 設置或返回密碼字段的 size 屬性值。 |
type | 返回密碼字段是哪種類型的表單元素。 |
value | 設置或返回密碼字段的 value 屬性值。 |
Input Password 對象方法
方法 | 描述 |
---|---|
select() | 選擇密碼字段的内容。 |
- 上一頁 <input> number
- 下一頁 <input> radio