HTML DOM Input FileUpload Object
FileUpload Object ကို ထည့်သွင်းပါ။
Input FileUpload object သည် type="file" ဖြင့် HTML <input> element ကို ကိုယ်စားပြုသည်။
Input FileUpload Object ကို ဝင်ရောက်ကြည့်ရှုပါ။
getElementById(): ကိုအသုံးပြုခြင်းဖြင့် type="file" ဖြင့် <input> element ကို ဝင်ရောက်ကြည့်ရှုနိုင်ပါသည်။
ဥပမာ
var x = document.getElementById("myFile");
အကြံပြုချက်- ဖောင် တစ်ခု၏ အစိတ်အပိုင်းများ စုစည်းမှု မှတစ်ဆင့် ရှာဖွေခြင်းဖြင့် <input type="file">ကိုလည်း သင်ဝင်ရောက်ကြည့်ရှု နိုင်ပါသည်။
Input FileUpload Object တစ်ခုဖန်တီးပါ။
document.createElement() နည်းလမ်းကို အသုံးပြု၍ type="file" ဖြင့် <input> element တစ်ခုကို ဖန်တီးနိုင်သည်-
ဥပမာ
var x = document.createElement("INPUT");
x.setAttribute("type", "file");
FileUpload Object Properties ကို ထည့်သွင်းပါ။
Property | Description |
---|---|
accept | Sets or returns the value of the accept attribute of the file upload button |
autofocus | Sets or returns whether a file upload button should automatically get focus upon page load |
defaultValue | Sets or returns the default value of the file upload button |
disabled | Sets or returns whether the file upload button is disabled, or not |
files | Returns a FileList object that represents the file or files selected with the file upload button |
form | Returns a reference to the form that contains the file upload button |
multiple | Sets or returns whether a user is allowed to select more than one file in the file upload field |
name | Sets or returns the value of the name attribute of the file upload button |
required | Sets or returns whether a file in the file upload field must be selected before submitting a form |
type | Returns which type of form element the file upload button is |
value | Returns the path or the name of the selected file |
စံသတ်မှတ်ချက်များနှင့် အစီအစဉ်များ
Input FileUpload object သည် စံ ဂုဏ်သတ္တိများ နှင့် အဖြစ်အပျက်များ ကို ပံ့ပိုး ပေးပါသည်။
ဆက်စပ်စာမျက်နှာများ
HTML သင်ခန်းစာ- HTML ပုံစံများ
HTML ရည်ညွှန်း- HTML <input> တဂ်
HTML ရည်ညွှန်း- HTML <input> type attribute