Members

Events

Note Starting with IE11, this event fires a MSPointerEvent object instead of MouseEvent. You can use the MouseEvent.pointerType property to determine the type of contact that the click originated from (touch, mouse, or pen).

Fires when the user clicks the right mouse button in the client area, opening the context menu.

Note Starting with IE11, this event fires a MSPointerEvent object instead of MouseEvent. You can use the MouseEvent.pointerType property to determine the type of contact that the click originated from (touch, mouse, or pen).

Note Starting with IE11, this event fires a MSPointerEvent object instead of a MouseEvent. You can use the MouseEvent.pointerType property to determine the type of contact that the click originated from (touch, mouse, or pen).

Specifies the offset within an animation cycle (the amount of time from the start of a cycle) before the animation is displayed for a set of corresponding object properties identified in the CSS @keyframes at-rule specified by the animation-name property.

Specifies the intermediate property values to be used during a single cycle of an animation on a set of corresponding object properties identified in the CSS @keyframes at-rule specified by the animation-name property.

Retrieves the number of immediate child nodes of the current element or a zero if the element does not contain any child nodes. childElementCount does not return all child nodes, only child nodes that are nodeType =1, or element nodes.

Gets or sets one or more values that specify the offset within a transition (the amount of time from the start of a transition) before the transition is displayed for a set of corresponding object properties identified in the transition property.

Standards information

Remarks

This element does not fire the onfocus event when it receives the input focus, unless it has been associated with a MAP element.

The following image and video file formats are supported:

.avi—Audio-Visual Interleaved (AVI)

.bmp—Windows Bitmap (BMP)

.emf—Windows Enhanced Metafile (EMF)

.png—Graphics Interchange Format (GIF)

.png, .jpeg—Joint Photographic Experts Group (JPEG)

.mov—Apple QuickTime Movie (MOV)

.mpg, .mpeg—Motion Picture Experts Group (MPEG)

.png—Portable Network Graphics (PNG)

.wmf—Windows Metafile (WMF)

.dds—Direct Draw Surface file. This is for Windows 8.1 and Windows Store app using JavaScript only.

When using the IMG element to display a static image, specify the URL of the image file with the SRC attribute. When using the IMG element to display a video clip or VRML world, specify the URL with the DYNSRC attribute.

Windows Internet Explorer 8 and later. In IE8 Standards mode, the title attribute is preferred over the alt attribute when specified as a pop-up tooltip for an img element. In addition, the value of the longDesc attribute depends on the current document compatibility mode.

The X Bitmap (XBM) file format is no longer supported as of Microsoft Internet Explorer 6 for Windows XP Service Pack 2 (SP2).

Internet Explorer 9. Setting the CLASS attribute of an image to msPinSite enables the user to drag the image to the Windows taskbar to pin the site. For more information, see Introduction to Pinned Sites.

Note

Windows 8.1 supports DDS file formats for Windows Store apps using JavaScript. DDS files are great for large textures and can contain a number of items, such as mipmaps (multiple resolution images) in the same file. While DDS files are supported on IE11, you should only use them for static images for Windows Runtime app using JavaScript and the Extensible Application Markup Language (XAML) WebView control. These apps typically download their images at install time. Dynamic images that are downloaded from the wire as needed can cause performance issues due to large file size. For best performance they should only be used for locally stored images for Windows Store apps using JavaScript.

Another consideration is that block compression formats deliver best quality when used with real world “natural” image data. Block compression formats can leave artifacts with computer generated images with high contrast shifts in color. This makes it important for developers to test if DDS is right for their visual assets.

Examples

The following example shows how to use the img element to embed a bitmap image (.bmp) on a page.