aspxtreme

USEMAP Attribute | useMap Property

HTML Elements/DHTML Objects   Element Attributes


Sets or retrieves the URL, often with a bookmark extension ( #name ), to use as a client-side image map.

Syntax


HTML <IMG USEMAP = sURL ... >
Script img.useMap [ = sURL ]

Possible Values


sURL String specifying the URL of the image map.

The property is read/write with no default value.

Remarks

Identifies the picture as a client-side image map and specifies a MAP object to use for responding to the user's mouse clicks. Use the MAP and AREA objects to create the client-side mapping information.

The maps may be dynamically assigned to the image through the useMap property.

Example

The following example specifies map1 as the image map underlying image.gif. The map can be changed to another map, "map2", by clicking the button.

<MAP NAME="map1">
<area NAME="area1" COORDS="0,0,40,40" 
  href="doc1.htm" target="frame1">
<area NAME="area2" COORDS="40,0,80,40" 
  href="doc2.htm" target="frame1">
<area NAME="area3" COORDS="10,40,40,80" 
  href="doc3.htm" target="frame1">
<area NAME="area4" COORDS="40,40,80,80" 
  href="doc4.htm" target="frame1">
</MAp>
...
<img src="image.gif" id=idImg USEMAP="#map1">
...
<button onclick="idImg.useMap='#map2'">
  Change Maps</button>
Applies To

IMG



Books and more ...

Contents
HTML Elements / DOM Objects
HTML Element Attributes
CSS Attributes
DOM Object Properties
DOM-compliant Events Reference
DOM Methods Reference
DOM Collections Reference
 


Suggested Reading



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme