Object useMap Attribute

Definition and Usage

useMap Attribute 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 with clickable areas.

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

See Also:

HTML Reference Manual:HTML <map> 标签

HTML Reference Manual:HTML <object> 标签

Example

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

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

Try It Yourself

Syntax

Return useMap Attribute:

objObject.useMap

Set useMap Attribute:

objObject.useMap = #mapname

Attribute Value

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

Technical Details

Return value: String value that indicates the name of the image map used with the object.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
支持 支持 支持 支持 支持

注释:所有主要浏览器都支持 useMap 属性。但是,<object> 元素的 usemap 属性仅在 Internet Explorer 和 Firefox 中受支持。