The usemap attribute on an <object> tag binds the image resource to an image-map.
This image-map partitions the image into clickable areas.
A usemap attribute on an <object> element.
The image has a map with 3 clickable areas: screen, keyboard, and mouse.
<object data="/img/html/computer-map.png" alt="Computer" type="image/png" usemap="#computer"></object>
<map name="computer">
<area shape="rect" coords="253,142,16,2" alt="Monitor" href="javascript:alert('Computer monitor was clicked');">
<area shape="rect" coords="262,218,0,156" alt="Keyboard" href="javascript:alert('Computer keyboard was clicked');">
<area shape="circle" coords="267,234,22" alt="Mouse" href="javascript:alert('Computer mouse was clicked');">
</map>
Note: There is only limited browser support for usemap on the <object> element.
The usemap attribute associates an embedded image with an image-map.
This image-map overlays the image with one or more clickable areas.
Note: Browser support for usemap on <object> tags is very limited.
<object usemap="#mapname">
Value | Description |
---|---|
#mapname | A hash character (#) followed by the name of the map to be used. |
Here is when usemap support started for each browser:
Chrome
|
Not Supported | |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
Not Supported | |
Opera
|
Not Supported | |
Safari
|
Not Supported |