Map nameProperty
Example
Get the name of the image map:
xThe output value is:
Try it Yourself »
Definition and Usage
The name property is used to set or return the value of the name attribute of an image map.
The name property describes the name of the image map.
The name property is associated with the usemap attribute of the <img> tag to create a relationship between the image and the map.
Note:When the name property is set, you also need to set the <img>'s usemap attribute - if not set, the image and map elements are no longer associated (clickable areas will no longer be clickable).
Note:In HTML5, the value of the id attribute and the name attribute of the <map> element must be the same (but null or empty values are not allowed).
Browser Support
![]()
All major browsers support the name property.
Syntax
Return the name property:
Set the name property:
Property Values
| Value | Description |
|---|---|
| name | Specifies the name of the image map |
Technical Details
| Return Value: | A string representing the name of the image map |
|---|
More Examples
Example
Change the name of the image map:
Try it Yourself »
Related Pages
HTML Reference:HTML <map> name Property
Other Extensions
Map Object