HTML DOM Object ကို ရွေး ပါ။
Object ကို ရွေးပါ။
Select object သည် HTML <select> element ကို ကိုယ်စားပြုသည်။
Object ကို ရွေးပါ။
getElementById() ကို အသုံးပြု၍ <select> ဒြပ်စင်တစ်ခုကို သင်ဝင်ရောက်နိုင်သည် ။
ဥပမာ
var x = document.getElementById("mySelect");
အကြံပြုချက်- ဖောင် တစ်ခု၏ အစိတ်အပိုင်း များစုစည်းမှု မှတစ်ဆင့် ရှာဖွေခြင်းဖြင့် Select object တစ်ခုကိုလည်း ဝင်ရောက်ကြည့်ရှု နိုင်ပါသည်။
Select Object တစ်ခုကို ဖန်တီးပါ။
document.createElement() နည်းလမ်းကို အသုံးပြု၍ <select> element တစ်ခုကို ဖန်တီးနိုင်သည်-
ဥပမာ
var x = document.createElement("SELECT");
Object Collections ကို ရွေးပါ။
Collection | Description |
---|---|
options | Returns a collection of all the options in a drop-down list |
Object Properties ကို ရွေးပါ။
Property | Description |
---|---|
autofocus | Sets or returns whether a drop-down list should automatically get focus when the page loads |
disabled | Sets or returns whether the drop-down list is disabled, or not |
form | Returns a reference to the form that contains the drop-down list |
length | Returns the number of <option> elements in a drop-down list |
multiple | Sets or returns whether more than one option can be selected from the drop-down list |
name | Sets or returns the value of the name attribute of a drop-down list |
selectedIndex | Sets or returns the index of the selected option in a drop-down list |
size | Sets or returns the value of the size of a drop-down list |
type | Returns which type of form element a drop-down list is |
value | Sets or returns the value of the selected option in a drop-down list |
Object Methods ကို ရွေးပါ။
Method | Description |
---|---|
add() | Adds an option to a drop-down list |
checkValidity() | |
remove() | Removes an option from a drop-down list |
စံသတ်မှတ်ချက်များနှင့် အစီအစဉ်များ
Select object သည် စံ ဂုဏ်သတ္တိများ နှင့် ဖြစ်ရပ်များ ကို ပံ့ပိုး ပေးပါသည်။
ဆက်စပ်စာမျက်နှာများ
HTML သင်ခန်းစာ- HTML ပုံစံများ
HTML ရည်ညွှန်း- HTML <select> tag