You are here: Reference > JavaScript > client-side > HTML DOM > objects > nodes and tags > map

map object

Browser support:
Contains coordinate data for client-side image maps.
The map element is used to specify one or more regions with the area element within an image. Perfect choice if you want to assign multiple links to multiple regions within an image, or one link to a portion of an image.

Syntax:

Methods that return the object:
document.createElement ("map")
The base interface, through which you can add new functionalities to the map object, is the HTMLMapElement interface.
If you want to see the HTML objects by categories, please visit this page.
HTML page for this element: map

Possible members:

Properties
Methods
Events
Style properties
accessKey
Sets or retrieves an access key to an element.
all
Represents a collection of all elements contained by an element or the entire document.
areas
Represents a collection of all area elements in a map element.
attributes
Represents a collection of attribute nodes that belong to an element.
baseURI
10
Returns the base URL for the object.
behaviorUrns
Represents a collection of the Uniform Resource Names for all behaviors attached to an element.
canHaveChildren
Retrieves a Boolean value that indicates whether the element can contain child elements.
canHaveHTML
Retrieves a Boolean value that indicates whether the element can contain HTML formatted text.
childElementCount
93.5
Returns the number of element nodes that are direct descendants of the current element.
childNodes
Represents a collection of all nodes that are direct descendants of an element.
children
3.5
Represents a collection of all element nodes that are direct descendants of an element.
className
Sets or retrieves the style class or classes that belong to the element.
currentStyle
Represents the computed style settings for an element.
dir
Sets or retrieves the text direction as related to the lang property.
firstChild
Returns a reference to the first child of the current element.
firstElementChild
93.5
Returns a reference to the first child element of the current element.
id
Sets or retrieves a unique identifier for the object.
innerHTML
Sets or retrieves the inner HTML content (the source code between the opening and closing tags) of an element.
innerText
Sets or returns the text content of an element including the text content of its descendants.
isContentEditable
Returns a Boolean value that indicates whether the contents of the object are editable by the user.
isDisabled
Returns a Boolean value that indicates whether the object is disabled.
isMultiLine
Returns a Boolean value that indicates whether the contents of an element can be multiline or not.
isTextEdit
Returns a Boolean value that indicates whether the createTextRange method can be used for the element.
lang
Specifies or returns the language of the element.
language
Sets or retrieves the scripting language for the current element. Use it only for the script element.
lastChild
Returns a reference to the last child of the current element.
lastElementChild
93.5
Returns a reference to the last child element of the current element.
localName
9
Returns the local part of the qualified name of the current node.
name
Sets or retrieves the name of an image map that helps to establish a relationship between an image and an image map.
namespaceURI
93.6
Sets or returns the namespace URI of the current node.
nextElementSibling
93.5
Returns a reference to the next child element of the current element's parent.
nextSibling
Returns a reference to the next child of the current element's parent.
nodeName
Returns the name of the current node.
nodeType
Returns an integer that indicates the type of the node.
nodeValue
Sets or returns the value of the current node.
offsetHeight
Returns the height of the visible area for an object, in pixels. The value contains the height with the padding, scrollBar, and the border, but does not include the margin.
offsetWidth
Returns the width of the visible area for an object, in pixels. The value contains the width with the padding, scrollBar, and the border, but does not include the margin.
outerHTML
Sets or retrieves the outer HTML content (the source code including the opening and closing tags) of an element.
outerText
Sets or returns the text content of an element including the text content of its descendants.
ownerDocument
Returns the document object that contains the current node.
parentElement
Returns the parent element of the object in the DOM hierarchy.
parentNode
Returns the parent element of the current node in the DOM hierarchy.
parentTextEdit
Returns the closest ancestor element of the current element in the DOM hierarchy that can be used to create a TextRange object.
previousElementSibling
93.5
Returns a reference to the previous child element of the current element's parent.
previousSibling
Returns a reference to the previous node of the current element's parent.
readyState
Returns a string value that represents the state of the object.
runtimeStyle
Represents the overridden style settings for an element.
scopeName
Retrieves the local name of the namespace declared for the current element.
sourceIndex
Returns the position of the current object in the all collection of the document.
style
Represents the inline style settings for an element or a CSS rule.
tabIndex
Specifies or returns the tabbing order for keyboard navigation using the TAB key.
tagName
Returns the tag name of the current element.
tagUrn
Sets or retrieves the Uniform Resource Name (URN) of the namespace declared for the current element.
textContent
9
Sets or returns the text content of an element including the text content of its descendants.
title
Specifies or returns a tooltip for an element.
uniqueID
Returns the unique identifier generated by the browser for the object.

Example HTML code 1:

This example illustrates the use of the map element:
<img src="area.gif" width="504px" height="126px" border="0px" alt="Solar System" usemap="#SampleMap" />
<map name="SampleMap">
    <area shape="rect" coords="1,-1,83,125" alt="rectangle" href="#" />
    <area shape="circle" coords="234,57,30" alt="circle" href="#" />
    <area shape="poly" coords="363,37,380,40,399,35,420,47,426,63,423,78,430,94,409,90,395,92,379,84,371,67,370,57" alt="polygon" href="#" />
</map>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content