HTML ismap Attribute

The HTML ismap attribute turns an image inside a link into a server-side image map, causing the coordinates where the user clicks the image to be added to the link's URL.

Elements That Use the ismap Attribute

The ismap attribute is used with the <img> element to identify an image as a server-side image map.

Element Description
<img> Causes the coordinates where the image is clicked to be sent as part of the link's URL.

Boolean Attribute

The ismap attribute is a Boolean attribute. Its presence enables the feature, and it does not require a value.

<img src="map.png" alt="Location map" ismap>

Writing ismap="false" does not disable the attribute. Because it is a Boolean attribute, its presence means that it is enabled.

How ismap Works

When the user clicks an image with the ismap attribute, the browser determines the horizontal and vertical coordinates of the click relative to the image's top-left corner.

The coordinates are appended to the URL as ?x,y. For example, clicking 120 pixels from the left and 75 pixels from the top can produce a URL such as:

/image-map.php?120,75

The server can then process the coordinates and determine what response to return.

Anchor Requirement

An <img> element using ismap must be a descendant of an <a> element with a valid href attribute.

<a href="/image-map.php">
  <img src="map.png" alt="Location map" ismap>
</a>

The link's href provides the URL to which the click coordinates are appended.

ismap vs. usemap

The ismap and usemap attributes both relate to image maps, but they use different methods to determine what happens when an image is selected.

Attribute Description
ismap Creates a server-side image map and sends the coordinates of the user's click to a server.
usemap Associates an image with a client-side <map> containing defined <area> elements.

Client-side image maps are generally preferred because the interactive areas can be represented directly in the HTML and made accessible to keyboard users.

Accessibility

Server-side image maps should generally be avoided because selecting a location depends on pointer coordinates. Users who cannot operate a mouse or similar pointing device may not be able to select the intended location.

When an image map is needed, a client-side image map using <map> and <area> elements is usually a better choice because individual areas can provide links and alternative text.

Common Mistakes

Do not use ismap on an image that is not inside an <a> element with a valid href. The link is required so the browser has a destination to which the coordinates can be appended.

Do not confuse ismap with usemap. The ismap attribute sends click coordinates to a server, while usemap associates an image with a client-side image map.

Do not rely on a server-side image map when users need an accessible way to select individual regions of an image. Prefer accessible links or a client-side image map when possible.

Browser Support

Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.

The ismap attribute on the <img> element is widely supported in current core browsers.

Checking Browser Support

For current browser compatibility information, visit Can I Use? . Search for the HTML element or attribute you want to check. You can also narrow your search by entering an element name and attribute name separated by a colon. Search results can include related HTML features, element attributes, input types, APIs, and other technologies, so select the result that most closely matches the feature you are checking.

Try the ismap Attribute

The example shows an image configured as a server-side image map. Clicking the image demonstrates how the browser appends the selected coordinates to the link URL.

Play in Editor

Summary

The HTML ismap attribute is a Boolean attribute used on an <img> element to create a server-side image map. The image must be inside an <a> element with a valid href. When the image is clicked, the browser appends the click coordinates to the URL as ?x,y. Because server-side image maps depend on pointer coordinates, client-side image maps or ordinary accessible links are generally preferable.