Latest web development tutorials
 

Image isMap Property

< 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

Property
isMap Yes Yes Yes Yes Yes

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