HTML - <Map>

This element is used to implement client-side image maps. The element is used to define a map to associate locations on an image with a destination URL. Each hot region or hyperlink mapping is defined by an enclosed <AREA> element. A map is bound to a particular image through the use of the USEMAP attribute in the <IMG> element, which is set to the name of the map.

Syntax

<MAP

CLASS="class name"
ID="unique alphanumeric identifier"
NAME="unique alphanumberic identifier"
STYLE="style information"
TITLE="advisory text"
onclick="script"
ondblclick="script"
onkeydown="script"
onkeypress="script"
onkeyup="script"
onmousedown="script"
onmousemove="script"
onmouseout="script"
onmouseover="script"
onmouseup="script">

<AREA> elements

</MAP>

Attributes

CLASS This attribute is set to indicate the class or classes that a particular element belongs to. A class name is used by a style sheet to associate style rules to multiple elements at once.
ID This attribute specifies a unique alphanumeric identifier to be associated with an element. Naming an element is important to being able to access it with a style sheet, a link, or a scripting language. Names should be unique to a document and should be meaningful.
NAME Like ID, this attribute is used to define a name associated with the element. In the case of the <MAP> element, the NAME attribute is the common way to define the name of the image map to be referenced by the USEMAP attribute within the <IMG> element.
STYLE This attribute specifies an inline style associated with the element. The style information is used to determine the rendering of the affected element.
TITLE This attribute supplies advisory text for the element that may be rendered as a tool tip when the mouse is over the element. A title may also simply provide information that alerts future document maintainers to the meaning of the element and its enclosed content.

Event Handlers

onclick Indicates that the element has been clicked.
ondblclick Indicates that the element has been double-clicked.
onkeydown Indicates that a key is being pressed down with focus on the element.
onkeypress Describes the event of a key being pressed and released with focus on the element.
onkeyup Indicates that s key is being released with focus on the element.
onmousedown Indicates the press of a mouse button with focus on the element.
onmousemove Indicates that the mouse has moved while over the element.
onmouseout Indicates that the mouse has moved away from an element.
onmouseover Indicates that the mouse has moved over an element.
onmouseup Indicates the release of a mouse button with focus on the element.

Examples

<MAP NAME="MAP_NAME">
          <AREA SHAPE="CIRCLE" COORDS="200,250,25" HREF="file1.htm">
          <AREA SHAPE="RECTANGLE" COORDS="50,50,100,100" 
                HREF="file2.htm#important">
          <AREA SHAPE="DEFAULT" NOHREF>
</MAP>