W3Schools.com

HTML DOM Image Object


Image Object

The Image object represents an embedded image.

For each <img> tag in an HTML document, an Image object is created.

Notice that images are not technically inserted into an HTML page, images are linked to HTML pages. The <img> tag creates a holding space for the referenced image.

Note: The Image object can also use the properties/methods of:


Image Object Properties

W3C: W3C Standard.

Property Description W3C
align Sets or returns the value of the align attribute of an image Yes
alt Sets or returns the value of the alt attribute of an image Yes
border Sets or returns the value of the border attribute of an image Yes
complete Returns whether or not the browser is finished loading an image No
height Sets or returns the value of the height attribute of an image Yes
hspace Sets or returns the value of the hspace attribute of an image Yes
longDesc Sets or returns the value of the longdesc attribute of an image Yes
lowsrc Sets or returns a URL to a low-resolution version of an image No
name Sets or returns the name of an image Yes
src Sets or returns the value of the src attribute of an image Yes
useMap Sets or returns the value of the usemap attribute of an image Yes
vspace Sets or returns the value of the vspace attribute of an image Yes
width Sets or returns the value of the width attribute of an image Yes

Image Object Events

Event The event occurs when... W3C
onabort Loading of an image is interrupted Yes
onerror An error occurs when loading an image Yes
onload An image is finished loading Yes

Standard Properties and Events

The Image object also supports the standard properties and events.



WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE