HTML DOM အင်တာ ပတ်ဝန်းကျင် ဘီတန်ဘာ
Input Password အရာ
Input Password အရာကို ပြောဆိုသည် type="password" ဖြစ်သော HTML <input> အကွက်ကို
Input Password အရာကို ဝင်ရောက်ရန်
type="password" ဖြစ်သော <input> အကွက်ကို ဝင်ရောက်ရန် getElementById() ကို သုံးနိုင်သည်:
var x = document.getElementById("myPsw");
အကြောင်းအရာ:သို့မဟုတ် ပေါ့ပ်ဖော်ပြီးသော ပေါ့ပ်အား elements အများအပြား input type="password"> ကို ဝင်ရောက်ရန်
Input Password အရာကို ဖန်တီးရန်
ကင်းသုံးနိုင်သော document.createElement() စက္ခုများကို type="password" ဖြစ်သော <input> အကွက်ကို ဖန်တီးရန်:
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() | 选取密码字段的内容。 |