HTML ismap Attribute

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The ismap attribute marks an <img> as a server-side image map. The image must sit inside an <a href>. When the user clicks, the browser appends ?x,y (CSS pixels from the image’s top-left) to the link URL so the server can choose the destination.

Regions are not defined in HTML with ismap. For clickable areas in the page itself, use usemap with <map> and <area> instead.

Baseline · Widely available.

Not deprecated and not experimental. Supported everywhere <img> works. Still valid HTML — but rarely the best choice for new UIs.

Accessibility warning.

Server-side maps need a pointing device. Prefer a client-side map (usemap) or plain text links so keyboard and assistive tech users are not left out.

HTML Syntax

syntax.html
<a href="url"><img src="..." alt="..."  ismap></a>

Boolean form: write ismap (or ismap="ismap"). The parent <a> must have a valid href.

Attribute Values

ismap is a boolean attribute — presence turns the feature on:

ValueDescriptionTry it
ismap (present)Server-side map on: click sends ?x,y to the anchor URLTry it
ismap="ismap"Same as bare ismap (XHTML-style boolean)Try it
AbsentNormal image in a link — no coordinates appendedTry it
JS: img.isMapDOM boolean reflecting the attributeTry it

Live Preview

Click the image. This demo shows the ?x,y URL the browser would request (navigation is blocked so you can keep studying).

ismap mode

With ismap on, a click reports coordinates. With it off, the link would navigate with no ?x,y.

Click the image
Sample diagram — click to preview ismap coordinates

ismap is on. Click the image to see the request URL.

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Server-Side Image Map

Wrap the image in a link and add ismap. The server at href receives the click point.

HTML
<a href="/html/tags/map">
  <img
    src="/images/area-example.png"
    alt="HTML and CSS diagram — click sends coordinates"
    width="256"
    height="256"
    ismap>
</a>
Try It Yourself

How It Works

  1. Require a link. ismap is valid only when the <img> is inside <a href>.
  2. Turn on the map. The boolean ismap tells the browser to send coordinates.
  3. Click builds a URL. The browser appends ?x,y in CSS pixels from the image’s top-left.
  4. Server decides. Your backend maps that point to a page or response — HTML does not define the regions.

Example 2 — Prefer Client-Side usemap

For new projects, define regions in HTML with usemap, <map>, and <area>.

HTML
<img
  src="/images/area-example.png"
  alt="HTML and CSS navigation diagram"
  width="256"
  height="256"
  usemap="#planet-map">

<map name="planet-map">
  <area shape="rect" coords="111,1,253,98" href="/html" alt="Learn HTML">
  <area shape="rect" coords="74,148,253,250" href="/css" alt="Learn CSS">
</map>
Try It Yourself

How It Works

  1. Point with usemap. usemap="#planet-map" matches <map name="planet-map">.
  2. Draw areas. Each <area> has shape, coords, href, and alt.
  3. Browser handles clicks. No coordinate query string and no custom CGI required.
  4. Better for a11y. Meaningful alt on each area beats a single opaque server hit.

Example 3 — Toggle isMap with JavaScript

The DOM property isMap mirrors the attribute. Turn it on only while the image stays inside a link.

HTML
<a href="/html/tags/map">
  <img id="mapImg" src="/images/area-example.png" alt="Toggle ismap demo" width="256" height="256">
</a>
<button type="button" id="toggle">Enable ismap</button>

<script>
  var img = document.getElementById("mapImg");
  var on = false;
  document.getElementById("toggle").addEventListener("click", function () {
    on = !on;
    img.isMap = on;
    this.textContent = on ? "Disable ismap" : "Enable ismap";
  });
</script>
Try It Yourself

How It Works

  1. Start without ismap. Clicks follow the link like a normal image link.
  2. Set img.isMap = true. Same effect as adding the attribute in HTML.
  3. Keep the parent <a>. Without a valid href ancestor, server-side map behavior does not apply.
  4. Use sparingly. Prefer static HTML for maps; JS toggling is mainly for demos and legacy UIs.

Edge Cases & Pitfalls

Most mistakes are missing the parent link, confusing usemap, or ignoring accessibility.

scope

Must be inside <a href>

MDN: ismap is allowed only if the image is a descendant of an anchor with a valid href. Alone on an <img>, it does nothing useful.

a11y

Pointer-only interaction

Meaningful regions need a mouse or touch. Offer text links or a client-side map with alt on each <area>.

compare

Not the same as usemap

ismap = server gets ?x,y. usemap = browser uses <map> / <area> in the document.

coords

CSS pixels from the top-left

Coordinates are relative to the image box, not the viewport. Scaling the image still reports CSS-pixel offsets for the click.

forms

Do not confuse with input type="image"

An image submit button also sends x/y with the form. That is a different control — not the ismap attribute.

Browser Support

ismap is an HTML attribute on images in the browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

ismap

Supported in all major browsers for decades as part of HTML image maps. Safe to rely on when reading legacy pages; prefer usemap for new designs.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Full support
ismap Widely supported

Bottom line: Universal support. The hard part is accessibility and server setup — not browser quirks.

Key Takeaways

  • Role: send click x,y to the server from an image link (server-side map).
  • Structure: <a href><img … ismap></a> only.
  • Boolean: presence enables it; JS uses isMap.
  • Modern default: use usemap + <map> / <area> for new maps.

One line: ismap appends ?x,y to the link — the server, not HTML, owns the regions.

Frequently Asked Questions

On an img inside an a element with href, ismap makes a server-side image map. A click appends ?x,y (CSS pixels from the image’s top-left) to the link URL so the server can decide the destination.
Only img, and only when that image is a descendant of an a element with a valid href. Outside a link, ismap has no effect.
Yes. Presence means true (write ismap or ismap="ismap"). There is no other meaningful value. In JavaScript use the isMap property.
ismap sends click coordinates to the server. usemap points to a map element with area regions defined in HTML (client-side). Prefer usemap for new work.
Server-side maps need a pointing device to pick coordinates. Keyboard and many assistive setups cannot choose a meaningful x,y. Client-side maps with area alt text are easier to make accessible.
The browser takes the anchor’s href and appends ?x,y — for example /cgi-bin/map?10,27 if the user clicked at (10, 27).

Next: kind

Learn the kind attribute on track elements for captions and chapters.

kind tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful