# The hash-name reference in attribute “usemap” referred to X, but there is no “map” element with a “name” attribute with that value.

> Canonical HTML version: https://rocketvalidator.com/html-validation/the-hash-name-reference-in-attribute-usemap-referred-to-x-but-there-is-no-map-element-with-a-name-attribute-with-that-value
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

An image's `usemap` attribute points to a `<map>` by name, and the page has no `<map>` whose `name` matches the text after the `#`.

The value of `usemap` is a hash-name reference: a `#` followed by the `name` of a `<map>` element in the same document. The `<area>` elements inside that map define the clickable regions of the image, so `usemap="#floor-plan"` needs a `<map name="floor-plan">` somewhere on the page.

The validator compares the two values exactly, so `<map name="Floor-Plan">` doesn't match. A `name` that repeats the `#` (`name="#floor-plan"`) doesn't match either, because the `#` belongs only in `usemap`. And a `<map>` with only `id="floor-plan"` won't do: `name` is required on `<map>`, and the validator reports its absence as a separate error.

If the page has no matching map at all, browsers show a plain image with no clickable regions, and visitors never see the links the map was supposed to provide. This often happens when an image is copied from another page, or inserted by a CMS, without the `<map>` that went with it.

Add the missing `<map>`, or fix the existing map's `name` so it matches the `usemap` value character for character. If the image doesn't need clickable regions, remove the `usemap` attribute instead.

## Invalid example

```html
<img src="floor-plan.png" alt="Office floor plan" width="400" height="300" usemap="#floor-plan">
<map name="Floor-Plan">
  <area shape="rect" coords="0,0,200,300" href="/rooms/kitchen" alt="Kitchen">
  <area shape="rect" coords="200,0,400,300" href="/rooms/meeting-room" alt="Meeting room">
</map>
```

## Valid example

```html
<img src="floor-plan.png" alt="Office floor plan" width="400" height="300" usemap="#floor-plan">
<map name="floor-plan">
  <area shape="rect" coords="0,0,200,300" href="/rooms/kitchen" alt="Kitchen">
  <area shape="rect" coords="200,0,400,300" href="/rooms/meeting-room" alt="Meeting room">
</map>
```
