Image isMap Property
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
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
|
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
Related Pages
HTML reference: HTML <img> ismap attribute
Image Object