HTML DOM Image Object
ရုပ်ပုံအရာဝတ္ထု
ရုပ်ပုံအရာဝတ္ထုသည် HTML <img> ဒြပ်စင်ကို ကိုယ်စားပြုသည်။
ရုပ်ပုံအရာဝတ္တုကို ဝင်ရောက်ကြည့်ရှုပါ။
getElementById() ကို အသုံးပြု၍ <img> ဒြပ်စင်တစ်ခုအား သင်ဝင်ရောက်နိုင်သည်။
ဥပမာ
var x = document.getElementById("myImg");
အကြံပြုချက်- ပုံ များစုစည်းမှု ကို အသုံးပြုခြင်းဖြင့် <img> ဒြပ်စင်တစ်ခုကိုလည်း သင်ဝင်ရောက်နိုင်သည် ။
Image Object တစ်ခုဖန်တီးပါ။
document.createElement() နည်းလမ်းကို အသုံးပြု၍ <img> ဒြပ်စင်တစ်ခုကို ဖန်တီးနိုင်သည်-
ဥပမာ
var x = document.createElement("IMG");
Image Object Properties
Property | Description |
---|---|
align | Not supported in HTML5. Use style.cssFloat instead. Sets or returns the value of the align attribute of an image |
alt | Sets or returns the value of the alt attribute of an image |
border | Not supported in HTML5. Use style.border instead. Sets or returns the value of the border attribute of an image |
complete | Returns whether or not the browser is finished loading an image |
crossOrigin | Sets or returns the CORS settings of an image |
height | Sets or returns the value of the height attribute of an image |
hspace | Not supported in HTML5. Use
style.margin instead. Sets or returns the value of the hspace attribute of an image |
isMap | Sets or returns whether an image should be part of a server-side image-map, or not |
longDesc | Not supported in HTML5. Sets or returns the value of the longdesc attribute of an image |
lowsrc | Not supported in HTML5. Sets or returns a URL to a low-resolution version of an image |
name | Not supported in HTML5. Use id instead. Sets or returns the value of the name attribute of an image |
naturalHeight | Returns the original height of an image |
naturalWidth | Returns the original width of an image |
src | Sets or returns the value of the src attribute of an image |
useMap | Sets or returns the value of the usemap attribute of an image |
vspace | Not supported in HTML5. Use
style.margin instead. Sets or returns the value of the vspace attribute of an image |
width | Sets or returns the value of the width attribute of an image |
စံသတ်မှတ်ချက်များနှင့် အစီအစဉ်များ
ရုပ်ပုံအရာဝတ္ထုသည် စံ ဂုဏ်သတ္တိများ နှင့် ဖြစ်ရပ်များ ကို ပံ့ပိုး ပေးပါသည်။
ဆက်စပ်စာမျက်နှာများ
HTML သင်ခန်းစာ- HTML ပုံများ
HTML ရည်ညွှန်း- HTML <img> တဂ်