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