Image isMap attribute

Definition and usage

isMap Attribute settings or returns whether the image should be part of the server-side image mapping (the image mapping is an image with clickable areas).

When clicking on the server-side image mapping, the click coordinates will be sent to the server as a URL query string.

This attribute reflects HTML ismap attribute.

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

Instance

Example 1

Determine if the image is part of the server-side image mapping:

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

Try it yourself

Example 2

Set the isMap attribute:

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

Try it yourself

Syntax

Return the isMap attribute:

imageObject.isMap

Set the isMap attribute:

imageObject.isMap = true|false

Attribute value

Value Description
true|false

Define whether the image should be part of the server-side image mapping.

  • true - The image will become part of the server-side image map
  • false - The image will not be part of the server-side image map

Technical Details

Return Value: Boolean value, returns true if the image is part of the server-side image map, otherwise returns false.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support

Related Pages

HTML Reference Manual:HTML <img> ismap Attribute