Object useMap Attribute

Definition and Usage

useMap Attribute that sets or returns the <object> element usemap attribute value.

The usemap attribute specifies the name of the image map used with the object.

An image map is an image that has clickable areas.

The usemap attribute is associated with the <map> element name attribute Associate with the object and create a relationship between the object and the map.

See Also:

HTML Reference Manual:HTML <map> Tag

HTML Reference Manual:HTML <object> Tag

Example

Get the name of the image map used with the object:

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

Try It Yourself

Syntax

Return the useMap attribute:

objObject.useMap

Set the useMap attribute:

objObject.useMap = #mapname

Attribute Value

Value Description
#mapname Specifies the hash character ("#") followed by the name of the map element to be used.

Technical Details

Return value: A string value that represents the name of the image map used with the object.

Browser Support

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

Note:All major browsers support the useMap attribute. However, the usemap attribute of the <object> element is only supported in Internet Explorer and Firefox.