HTML <map> name Attribute
Example
<img src="desk.jpg" usemap="#image-map">
<map name="image-map">
<area target="_blank" alt="Computer" title="Computer" href="computer.png" coords="112,31,285,246" shape="rect">
<area target="_blank" alt="Cup" title="Cup" href="cup.png" coords="327,212,31" shape="circle">
<area target="_blank" alt="Mobile" title="Mobile" href="mobile.png" coords="296,121,326,176" shape="rect">
<area target="_blank" alt="Book" title="Book" href="book.png" coords="53,132,115,157,72,237,2,211" shape="poly">
</map>
Meaning
The name attribute is used to define a name associated with the element.
In the case of the map element, the name attribute is the common way to define the name of the image map to be referenced by the usemap attribute within an <img> element.
Notes:
- The attribute must be present and must have a non-empty value with no space characters.
- The value of the name attribute must not be equal to the value of the name attribute of another map element in the same document.
- If the id attribute is also specified, both attributes must have the same value.
Standard Syntax
<img src="URL" alt="txt" usemap="#idName" width="px" height="px">
<map name="idName">
<area shape="circle | default | poly | rect"" coords="coordinates" alt="txt" href="URL">
</map>
Advertisement
Attribute Values
| Value | Description |
|---|---|
| idName | Specifies the name of the image map |