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