THE WORLD'S LARGEST WEB DEVELOPER SITE

Image isMap Property

Image Object Reference Image Object

Example

Find out if an image is part of a server-side image-map:

var x = document.getElementById("myImg").isMap;

The result of x will be:

true

Try it yourself »

Definition and Usage

The isMap property sets or returns whether an image should be part of a server-side image-map (an image-map is an image with clickable areas), or not.

When clicking on a server-side image-map, the click coordinates are sent to the server as a URL query string.

This property reflects the HTML ismap attribute.

Note: The ismap attribute is only allowed if the <img> element is a descendant of an <a> element with a valid href attribute.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The isMap property is supported in all major browsers.


Syntax

Return the isMap property:

imageObject.isMap

Set the isMap property:

imageObject.isMap=true|false

Property Values

Value Description
true|false Specifies whether the image should be part of a server-side image-map, or not
  • true - The image will be part of a server-side image-map
  • false -The image will NOT be part of a server-side image-map

Technical Details

Return Value: A Boolean, returns true if the image is part of a server-side image-map, otherwise it returns false

More Examples

Example

Set the isMap property:

document.getElementById("myImg").isMap = true;

Try it yourself »

Related Pages

HTML reference: HTML <img> ismap attribute


Image Object Reference Image Object

COLOR PICKER

colorpicker

SHARE THIS PAGE






Search w3schools.com:

Translate w3schools.com: