/

HTML / CSS / JavaScript Tutorial

HTML Element: <map>

[this page | pdf | back links]

The HTML <map> element indicates a client-side image-map (i.e. an image with clickable areas). It needs a name attribute, which creates a relationship between the image and the map. It typically contains one or more <area> elements that indicate which parts of the image map are clickable. In HTML 5, if the id attribute of the <map> element is specified then it needs to have the same value as the name attribute.

 

The attributes it can take (other than HTML global attributes and HTML event attributes) include:

 

Attribute

Description

More

name

Name of associated element

Here

 

To create or access such an element in JavaScript see here. The corresponding HTML DOM object supports standard DOM properties and methods, and additional properties with the same name and meaning as the attributes of the underlying HTML element referred to above. It also supports the following additional properties:

 

Property

Description

More

areas

Returns a collection of all <area> elements linked to the <map> element

Here

images

Returns a collection of all <img> and <object> elements linked to the <map> element

Here

 

The default style applicable to this element is shown here.

 


NAVIGATION LINKS
Contents | Prev | Next | HTML Elements


Desktop view | Switch to Mobile