USEMAP attribute for IMG

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm confused about valid values for the IMG element's USEMAP

According to this specification, "the value of usemap must match the
value of the name attribute of the associated MAP element":

So, for example, I'd expect to write
<img src="blah.png" usemap="mymap" ... >
<map name="mymap" ... >

However (at least in MSIE 6.0), such an image map does not work. A
hash sign must be prepended to the usemap attribute ("#mymap") or none
of the clickable regions will be active, making the map useless. This
suggests to me that usemap is actually a URI (and might just as well
be written "thispage.html#mymap") - but it contradicts the

Is this an IE bug? What values are really valid?


Re: USEMAP attribute for IMG

On Wed, 3 May 2006, Paul E Collins wrote:

Quoted text here. Click to load it

The formal specification however says that the value of a usemap
attribute is a URI.

RFC1980, the original definition of client-side imagemaps, included
the possibility that the imagemap could be in an external document,
referenced by the URI specified in the USEMAP attribute.  In practice,
the full specification did not get widely implemented: one is expected
to specify the anchor of a MAP element within the current document.

Quoted text here. Click to load it


When it says "must match", it doesn't mean "must be equal to".

See the examples
for sample usage.

h t h

Site Timeline