Image useMap Property

Image Object Reference Image Object


Set the useMap property:

document.getElementById("planets").useMap = "#planetmap";

Try it yourself »

Definition and Usage

The useMap property sets or returns the value of the usemap attribute of an image.

The usemap attribute specifies an image as a client-side image-map (an image-map is an image with clickable areas).

The usemap attribute is associated with a map element's name attribute, and creates a relationship between the image and the map.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The useMap property is supported in all major browsers.


Return the useMap property:


Set the useMap property:


Property Values

Value Description
#mapname A hash character ("#") plus the name of the map element to use

Technical Details

Return Value: A String, representing the value of the usemap attribute of the image, including the hash character ("#")

More Examples


Return the value of the usemap attribute of an image:

var x = document.getElementById("planets").useMap;

The result of x will be:


Try it yourself »

Related Pages

HTML reference: HTML <img> usemap attribute

Image Object Reference Image Object


Color Picker