HTML DOM Input Checkbox Object
Input Checkbox Object
Input Checkbox အရာဝတ္ထုသည် type="checkbox" ဖြင့် HTML <input> ဒြပ်စင်ကို ကိုယ်စားပြုသည်။
Input Checkbox Object ကို ဝင်ရောက်ကြည့်ရှုပါ။
getElementById() ကိုအသုံးပြုခြင်းဖြင့် type="checkbox" ဖြင့် <input> element ကို ဝင်ရောက်ကြည့်ရှုနိုင်သည်
ဥပမာ
var x = document.getElementById("myCheck");
အကြံပြုချက်- ဖောင် တစ်ခု၏ အစိတ်အပိုင်းများ စုစည်းမှု မှတစ်ဆင့် ရှာဖွေခြင်းဖြင့် <input type="checkbox">ကိုလည်း သင် ဝင်ရောက်ကြည့်ရှု နိုင်ပါသည်။
Input Checkbox Object တစ်ခုကို ဖန်တီးပါ။
document.createElement() နည်းလမ်းကို အသုံးပြု၍ type="checkbox" ဖြင့် <input> element တစ်ခုကို ဖန်တီးနိုင်သည်-
ဥပမာ
var x = document.createElement("INPUT");
x.setAttribute("type", "checkbox");
Input Checkbox Object Properties
Property | Description |
---|---|
autofocus | Sets or returns whether a checkbox should automatically get focus when the page loads |
checked | Sets or returns the checked state of a checkbox |
defaultChecked | Returns the default value of the checked attribute |
defaultValue | Sets or returns the default value of a checkbox |
disabled | Sets or returns whether a checkbox is disabled, or not |
form | Returns a reference to the form that contains the checkbox |
indeterminate | Sets or returns the indeterminate state of the checkbox |
name | Sets or returns the value of the name attribute of a checkbox |
required | Sets or returns whether the checkbox must be checked before submitting a form |
type | Returns which type of form element the checkbox is |
value | Sets or returns the value of the value attribute of a checkbox |
စံသတ်မှတ်ချက်များနှင့် အစီအစဉ်များ
Input Checkbox အရာဝတ္ထုသည် စံ ဂုဏ်သတ္တိများ နှင့် ဖြစ်ရပ်များ ကို ပံ့ပိုး ပေးပါသည်။
ဆက်စပ်စာမျက်နှာများ
HTML သင်ခန်းစာ- HTML ပုံစံများ
HTML ရည်ညွှန်း- HTML <input> တဂ်
HTML ရည်ညွှန်း- HTML <input> type attribute