Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Image width property

Image width property

Image Object Reference Image Object


Definition and Usage

The width property sets or returns the value of the width attribute of an image.

The width attribute specifies the width of the image.

Syntax

imageObject.width=

pixels


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the width property


Example

Example

Change the height and width of the image:

Runoob Tutorial(runoob.com)



Try it »


Image Object Reference Image Object