Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <object> usemap Attribute

The usemap attribute on an <object> tag binds the image resource to an image-map.

This image-map partitions the image into clickable areas.

Example

#

A usemap attribute on an <object> element. The image has a map with 3 clickable areas: screen, keyboard, and mouse.

Monitor Keyboard 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.


Using usemap

The usemap attribute associates an embedded image with an image-map.

This image-map overlays the image with one or more clickable areas.

The usemap attribute accepts the name of the <map> element.

Note:  Browser support for usemap on <object> tags is very limited.


Syntax

<object usemap="#mapname">

Values

#

Value Description
#mapname A hash character (#) followed by the name of the map to be used.

Browser support

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

You may also like

 Back to <object>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides