HTML <map> tagS2C Home   « HTML <map> tag

Definition

The <map> tag is used to define to define a client-side image map that has clickable areas.

Example


<map id="lesson3"></map>

Required Attributes

id attribute specifies a unique identifier for the map.


<map id="idname"></map>

Optional Attributes

name attribute specifies a name for the map.


<map name="mapname"></map>

Common Attributes

class - specifies a classname for the element allowing you to apply the style of the predefined class to the content.


<map class="classname"></map>

style - specifies an inline style for the element allowing you to apply the style to the content.


<map style="color:red;text-align:left"></map>

title - specifies extra information about the content.


<map title="information about the content"></map>

Language Attributes

dir - specifies the directional flow of the content.


<map dir="ltr"></map>   <!-- The text will flow from left to right -->

<map dir="rtl"></map>   <!-- The text will flow from right to left -->

lang - specifies a language code for the content of the element.


<map lang="en"></map>

xml:lang - specifies a language code for the content of the element in XHTML documents.


<map xml:lang="fr"></map>

Document Event Attributes

NONE

Form Event Attributes

NONE

Image Event Attributes

NONE

Keyboard Event Attributes

onkeydown - The JavaScript code to be run when an element is in focus and keyboard key is pressed.


<map onkeydown="go()"></map>   <!-- Executes the go() function -->

onkeypress - The JavaScript code to be run when an element is in focus and keyboard key is pressed down and released.


<map onkeypress="go()"></map>   <!-- Executes the go() function -->

onkeyup - The JavaScript code to be run when an element is in focus and keyboard key is released.


<map onkeyup="go()"></map>   <!-- Executes the go() function -->

Mouse Event Attributes

onclick - The JavaScript code to be run when a mouse is clicked on the element.


<map onclick="go()"></map>   <!-- Executes the go() function -->

ondblclick - The JavaScript code to be run when a mouse is double clicked on the element.


<map ondblclick="go()"></map>   <!-- Executes the go() function -->

onmousedown - The JavaScript code to be run when the mouse button is pressed down while the cursor is over the element.


<map onmousedown="go()"></map>   <!-- Executes the go() function -->

onmousemove - The JavaScript code to be run when the mouse button is moved.


<map onmousemove="go()"></map>   <!-- Executes the go() function -->

onmouseout - The JavaScript code to be run when the mouse cursor moves off an element.


<map onmouseout="go()"></map>   <!-- Executes the go() function -->

onmouseover - The JavaScript code to be run when the mouse cursor moves over an element.


<map onmouseover="go()"></map>   <!-- Executes the go() function -->

onmouseup - The JavaScript code to be run when the mouse button is released while the cursor is over the element.


<map onmouseup="go()"></map>   <!-- Executes the go() function -->

go to home page Homepage go to top of page Top