Map name Property
Example
Get the name of the image map:
var x = document.getElementById("planetmap").name;
x Output value:
planetmap
Try it »
Definition and usage
The name property sets or returns the value of the name attribute of the image map.
The name property describes the name of the image map.
The name property is associated with the usemap attribute of the tag, to create the relationship between the image and the map.
Note: When the name property is set, you also need to set 's usemap attribute - if not set, the image and map elements are no longer associated (the clickable areas will no longer be clickable).
Note: In HTML5,
Browser support

All major browsers support the name attribute.
Syntax
Return the name attribute:
mapObject
.name
Set the name attribute:
mapObject
.name=
name
Attribute values
| Value | Description |
|---|---|
| name | Specify the name of the image map |
Technical description
| Return value: | String, representing the name of the image map |
|---|
More examples
Example
Modify the name of the image map:
document.getElementById("planetmap").name = "newMapName";
Try it »
Related pages
HTML Reference Manual: HTML
Map object