HTML - attributes - u....

revision:


"usemap" attribute : specifies an image as an image map

The usemap attribute specifies an image (or an object) as an image map (i.e an image with clickable areas).The usemap attribute is associated with a <map> element's "name" or "id" attribute, and creates a relationship between the <img> and the <map>.

The usemap attribute can be used on the following elements: <img> and <object>.

The usemap attribute cannot be used if the <img> element is a descendant of an <a> or <button> element.

syntax

<element usemap="#mapname"></element>

#mapname: a hash character ("#") plus the name of the <map> element to use.

some examples

example
Computer screen keyboard mouse

codes:

                    <img src="../pics/computer-map.png" alt="Computer" usemap="#computermap">
                    <map name="computermap">
                    <area shape="rect" coords="253,142,16,2" alt="screen" 
                            href="javascript:alert('screen was clicked');">
                    <area shape="rect" coords="262,218,0,156" alt="keyboard" 
                            href="javascript:alert('keyboard was clicked');">
                    <area shape="circle" coords="267,234,22" alt="mouse" 
                            href="javascript:alert('mouse was clicked');">
                    </map>