CKTIS / HTML
ismap — server-side image map
The boolean `ismap` attribute on `img` marks a server-side image map. The image must be inside an `a` element with `href`. When clicked, the browser appends coordinates to the link URL; interpreting those coordinates is the server's responsibility.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<a href="/map"><img src="map.png" alt="Map" ismap></a>ismap is a boolean attribute of img. It may be specified only when the image has an ancestor a element with an href attribute. Its presence enables the server-side image-map mechanism; it does not define regions or their destinations in the document.
When the image is clicked, the browser appends a ?x,y suffix to the link URL. Coordinates are expressed as decimal integers and measured in CSS pixels from the image's top-left corner, not in source-file pixels. Negative values are clamped to zero. For an untrusted event, such as one triggered by script, the algorithm uses 0,0.
Valid forms are ismap, ismap="", and ismap="ismap". Writing ismap="false" is invalid and does not disable the mechanism: the attribute is still present. Remove the attribute to disable it.
Unlike usemap, which references a client-side map, ismap sends coordinates to the server. The server must interpret them and choose a response. Also provide text links to the same functions so that selection does not require precise pointing at the image.
In the example, the link targets #result, and the click handler calls event.preventDefault() to prevent navigation. The example shows how the isMap DOM property reflects the ismap attribute: it starts as true, setting it to false removes the attribute, and restoring the initial value adds the attribute back. Clicking does not send a request containing coordinates.
Examples
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Server-side image map attribute</title>
</head>
<body>
<a id="map-link" href="#result"><img id="map-image" ismap width="80" height="40" alt="Sample server-side image map" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40'%3E%3Crect width='80' height='40' fill='steelblue'/%3E%3C/svg%3E"></a>
<pre id="result"></pre>
<script>
const image = document.getElementById('map-image');
const link = image.closest('a[href]');
link.addEventListener('click', event => event.preventDefault());
const enabled = image.isMap;
image.isMap = false;
const presentAfterClearing = image.hasAttribute('ismap');
image.isMap = enabled;
document.getElementById('result').textContent = [
`Inside a link with href: ${Boolean(link)}`,
`Image map enabled: ${enabled}`,
`ismap present after setting isMap to false: ${presentAfterClearing}`
].join('\n');
</script>
</body>
</html>Result
Inside a link with href: true Image map enabled: true ismap present after setting isMap to false: false
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.