X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Image useMap Property

Image Object Reference Image Object

Example

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.


Syntax

Return the useMap property:

imageObject.useMap

Set the useMap property:

imageObject.useMap=#mapname

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

Return Value

Type Description
String The value of the usemap attribute of the image, including the hash character ("#")


More Examples

Example

Return the value of the usemap attribute of an image:

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

The result of x will be:

#planetmap

Try it yourself »


Related Pages

HTML reference: HTML <img> usemap attribute


Image Object Reference Image Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook