AREA Element | area Object
Defines the shape, coordinates, and associated URL of one hyperlink region within a client-side image map.
Members Table
The following table lists the members exposed by the
area
object. Click a tab on the left to choose the type of member you want to view.
Attributes/Properties
| Attribute | Property | Description |
|---|
| ACCESSKEY | accessKey |
Sets or retrieves the accelerator key for the object. |
| ALT | alt |
Sets or retrieves a text alternative to the graphic. |
| ATOMICSELECTION | |
Specifies whether the element and its contents must be selected as a whole, indivisible unit.
|
| BEGIN | BEGIN |
Sets or retrieves the delay time before the timeline begins playing on the element. |
| canHaveHTML |
Sets or retrieves the value indicating whether the object can contain rich HTML markup. |
| CLASS | className |
Sets or retrieves the class of the object. |
| COORDS | coords |
Sets or retrieves the coordinates of the object. |
| DIR | dir |
Sets or retrieves the reading order of the object. |
| disabled |
Sets or retrieves the value that indicates whether the user can interact with the object. |
| END | END |
Sets or retrieves a value indicating the end time for the element, or the end of the simple duration when the element is set to repeat. |
| firstChild |
Retrieves a reference to the first child in the childNodes collection of the object. |
| hash |
Sets or retrieves the subsection of the href property that follows the number sign (#). |
| hasMedia |
Retrieves a Boolean value that indicates whether the element is an Introduction to HTML+TIME media element. |
| HIDEFOCUS | hideFocus |
Sets or retrieves the value indicating whether the object visibly indicates that it has focus. |
| host |
Sets or retrieves the hostname and port number of the location or URL. |
| hostname |
Sets or retrieves the host name part of the location or URL. |
| HREF | href |
Sets or retrieves the destination URL or anchor point. |
| ID | id |
Retrieves the string identifying the object. |
| isContentEditable |
Retrieves the value indicating whether the user can edit the contents of the object. |
| isDisabled |
Retrieves the value indicating whether the user can interact with the object. |
| isMultiLine |
Retrieves the value indicating whether the content of the object contains one or more lines. |
| isTextEdit |
Retrieves whether a TextRange object can be created using the object. |
| LANG | lang |
Sets or retrieves the language to use. |
| LANGUAGE | language |
Sets or retrieves the language in which the current script is written. |
| lastChild |
Retrieves a reference to the last child in the childNodes collection of an object. |
| nextSibling |
Retrieves a reference to the next child of the parent for the object. |
| nodeName |
Retrieves the name of a particular type of node. |
| nodeType |
Retrieves the type of the requested node. |
| nodeValue |
Sets or retrieves the value of a node. |
| NOHREF | noHref |
Sets or retrieves whether clicks in this region cause action. |
| offsetHeight |
Retrieves the height of the object relative to the layout or coordinate parent, as specified by the offsetParent property. |
| offsetLeft |
Retrieves the calculated left position of the object relative to the layout or coordinate parent, as specified by the offsetParent property. |
| offsetParent |
Retrieves a reference to the container object that defines the offsetTop and offsetLeft properties of the object. |
| offsetTop |
Retrieves the calculated top position of the object relative to the layout or coordinate parent, as specified by the offsetParent property. |
| offsetWidth |
Retrieves the width of the object relative to the layout or coordinate parent, as specified by the offsetParent property. |
| outerHTML |
Sets or retrieves the object and its content in HTML. |
| outerText |
Sets or retrieves the text of the object. |
| ownerDocument |
Sets or retrieves the document object associated with the node. |
| parentElement |
Retrieves the parent object in the object hierarchy. |
| parentNode |
Retrieves the parent object in the document hierarchy. |
| parentTextEdit |
Retrieves the container object in the document hierarchy that can be used to create a TextRange containing the original object. |
| pathname |
Sets or retrieves the file name or path specified by the object. |
| port |
Sets or retrieves the port number associated with a URL. |
| previousSibling |
Retrieves a reference to the previous child of the parent for the object. |
| protocol |
Sets or retrieves the protocol portion of a URL. |
| readyState |
Retrieves the current state of the object. |
| scopeName |
Retrieves the namespace defined for the element. |
| search |
Sets or retrieves the substring of the href property that follows the question mark. |
| SHAPE | shape |
Sets or retrieves the shape of the object. |
| sourceIndex |
Retrieves the ordinal position of the object, in source order, as the object appears in the document's all collection. |
| STYLE | |
Sets an inline style for the element. |
| SYNCMASTER | SYNCMASTER |
Sets or retrieves whether the time container must synchronize playback to this element. |
| systemBitrate | |
Retrieves the approximate bandwidth available to the system in bits-per-second. |
| systemCaptions | |
Indicates whether or not to display a text equivalent of the audio portion of the presentation. |
| systemLanguage | |
Indicates whether a given language is selected in a user's system preferences. |
| systemOverdubOrSubtitle | |
Specifies whether overdubs or subtitles render during a presentation. |
| TABINDEX | tabIndex |
Sets or retrieves the index that defines the tab order for the object. |
| tagName |
Retrieves the tag name of the object. |
| tagUrn |
Sets or retrieves the Uniform Resource Name (URN) specified in the namespace declaration. |
| TARGET | target |
Sets or retrieves the window or frame at which to target content. |
| TIMECONTAINER | TIMECONTAINER |
Sets or retrieves the type of timeline associated with an element. |
| TITLE | title |
Sets or retrieves advisory information (a ToolTip) for the object. |
| uniqueID |
Retrieves an autogenerated, unique identifier for the object. |
| UNSELECTABLE | |
Specifies that an element cannot be selected. |
Behaviors
| Behavior | Description |
|---|
| clientCaps |
Provides information about features supported by Internet Explorer, as well as a way for installing browser components on demand. |
| download |
Downloads a file and notifies a specified callback function when the download is complete. |
| homePage |
Contains information about a user's homepage. |
| httpFolder |
Contains scripting features that enable browser navigation to a folder view. |
| saveFavorite |
Enables the object to persist data in a favorite Web site. |
| saveHistory |
Enables the object to persist data in the browser history. |
| saveSnapshot |
Enables the object to persist data when a Web page is saved. |
| time |
Provides an active timeline for an HTML element. |
| time2 |
Provides an active timeline for an HTML element or group of elements. |
| userData |
Enables the object to persist data in user data. |
Collections
| Collection | Description |
|---|
| all |
Returns a reference to the collection of elements contained by the object. |
| attributes |
Retrieves a collection of attributes of the object. |
| behaviorUrns |
Returns a collection of Uniform Resource Name (URN) strings identifying the behaviors attached to the element. |
| childNodes |
Retrieves a collection of HTML Elements and TextNode objects that are direct descendants of the specified object. |
| children |
Retrieves a collection of DHTML Objects that are direct descendants of the object. |
Events
| Event | Description |
|---|
| onactivate |
Fires when the object is set as the active element. |
| onbeforeactivate |
Fires immediately before the object is set as the active element. |
| onbeforecopy |
Fires on the source object before the selection is copied to the system clipboard. |
| onbeforecut |
Fires on the source object before the selection is deleted from the document. |
| onbeforedeactivate |
Fires immediately before the activeElement is changed from the current object to another object in the parent document. |
| onbeforeeditfocus |
Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. |
| onbeforepaste |
Fires on the target object before the selection is pasted from the system clipboard to the document. |
| onblur |
Fires when the object loses the input focus. |
| onclick |
Fires when the user clicks the left mouse button on the object. |
| oncontextmenu |
Fires when the user clicks the right mouse button in the client area, opening the context menu. |
| oncontrolselect |
Fires when the user is about to make a control selection of the object. |
| oncopy |
Fires on the source element when the user copies the object or selection, adding it to the system clipboard. |
| oncut |
Fires on the source element when the object or selection is removed from the document and added to the system clipboard. |
| ondblclick |
Fires when the user double-clicks the object. |
| ondeactivate |
Fires when the activeElement is changed from the current object to another object in the parent document. |
| ondrag |
Fires on the source object continuously during a drag operation. |
| ondragend |
Fires on the source object when the user releases the mouse at the close of a drag operation. |
| ondragenter |
Fires on the target element when the user drags the object to a valid drop target. |
| ondragleave |
Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. |
| ondragover |
Fires on the target element continuously while the user drags the object over a valid drop target. |
| ondragstart |
Fires on the source object when the user starts to drag a text selection or selected object. |
| ondrop |
Fires on the target object when the mouse button is released during a drag-and-drop operation. |
| onfocus |
Fires when the object receives focus. |
| onfocusin |
Fires for an element just prior to setting focus on that element. |
| onfocusout |
Fires for the current element with focus immediately after moving focus to another element. |
| onhelp |
Fires when the user presses the F1 key while the browser is the active window. |
| onkeydown |
Fires when the user presses a key. |
| onkeypress |
Fires when the user presses an alphanumeric key. |
| onkeyup |
Fires when the user releases a key. |
| onlosecapture |
Fires when the object loses the mouse capture. |
| onmousedown |
Fires when the user clicks the object with either mouse button. |
| onmouseenter |
Fires when the user moves the mouse pointer into the object. |
| onmouseleave |
Fires when the user moves the mouse pointer outside the boundaries of the object. |
| onmousemove |
Fires when the user moves the mouse over the object. |
| onmouseout |
Fires when the user moves the mouse pointer outside the boundaries of the object. |
| onmouseover |
Fires when the user moves the mouse pointer into the object. |
| onmouseup |
Fires when the user releases a mouse button while the mouse is over the object. |
| onmousewheel |
Fires when the wheel button is rotated. |
| onmove |
Fires when the object moves. |
| onmoveend |
Fires when the object stops moving. |
| onmovestart |
Fires when the object starts to move. |
| onpaste |
Fires on the target object when the user pastes data, transferring the data from the system clipboard to the document. |
| onpropertychange |
Fires when a property changes on the object. |
| onreadystatechange |
Fires when the state of the object has changed. |
| onresizeend |
Fires when the user finishes changing the dimensions of the object in a control selection. |
| onresizestart |
Fires when the user begins to change the dimensions of the object in a control selection. |
| onselectstart |
Fires when the object is being selected. |
| ontimeerror |
Fires whenever a time-specific error occurs, usually as a result of setting a property to an invalid value. |
Methods
| Method | Description |
|---|
| addBehavior |
Attaches a behavior to the element. |
| applyElement |
Makes the element either a child or parent of another element. |
| attachEvent |
Binds the specified function to an event, so that the function gets called whenever the event fires on the object. |
| blur |
Causes the element to lose focus and fires the onblur event. |
| clearAttributes |
Removes all attributes and values from the object. |
| click |
Simulates a click by causing the onclick event to fire. |
| cloneNode |
Copies a reference to the object from the document hierarchy. |
| componentFromPoint |
Returns the component located at the specified coordinates via certain events. |
| contains |
Checks whether the given element is contained within the object. |
| detachEvent |
Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires. |
| dragDrop |
Initiates a drag event. |
| fireEvent |
Fires a specified event on the object. |
| focus |
Causes the element to receive the focus and executes the code specified by the onfocus event. |
| getAdjacentText |
Returns the adjacent text string. |
| getAttribute |
Retrieves the value of the specified attribute. |
| getAttributeNode |
Retrieves an attribute object referenced by the attribute.name property. |
| getBoundingClientRect |
Retrieves an object that specifies the bounds of a collection of TextRectangle objects. |
| getClientRects |
Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. Each rectangle describes a single line. |
| getElementsByTagName |
Retrieves a collection of objects based on the specified element name. |
| getExpression |
Retrieves the expression for the given property. |
| hasChildNodes |
Returns a value that indicates whether the object has children. |
| insertAdjacentElement |
Inserts an element at the specified location. |
| insertAdjacentHTML |
Inserts the given HTML text into the element at the location. |
| insertAdjacentText |
Inserts the given text into the element at the specified location. |
| mergeAttributes |
Copies all read/write attributes to the specified element. |
| normalize |
Merges adjacent TextNode objects to produce a normalized document object model. |
| releaseCapture |
Removes mouse capture from the object in the current document. |
| removeAttribute |
Removes the given attribute from the object. |
| removeAttributeNode |
Removes an attribute object from the object. |
| removeBehavior |
Detaches a behavior from the element. |
| removeExpression |
Removes the expression from the specified property. |
| replaceAdjacentText |
Replaces the text adjacent to the element. |
| scrollIntoView |
Causes the object to scroll into view, aligning it either at the top or bottom of the window. |
| setActive |
Sets the object as active without setting focus to the object. |
| setAttribute |
Sets the value of the specified attribute. |
| setAttributeNode |
Sets an attribute object node as part of the object. |
| setCapture |
Sets the mouse capture to the object belonging to the current document. |
| setExpression |
Sets an expression for the specified object. |
| swapNode |
Exchanges the location of two objects in the document hierarchy. |
Styles
| Style attribute | Style property | Description |
|---|
| behavior | behavior |
Sets or retrieves the location of the Introduction to DHTML Behaviors. |
Remarks
Any number of area elements can be contained within the same map element.
The format of the COORDS value depends on the value of the SHAPE attribute.
This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.
This element is not rendered.
This element does not require a closing tag.
Example
This example provides the code for an image map of the solar system. It creates links from the image map to individual images of the planets using the area element with the map element, COORDS value, and SHAPE attribute. The user clicks the sun or any planet to link to an individual image. To return to the solar system image map, the user clicks the Back button.
<P><IMG SRC="solarsys.gif" WIDTH=504 HEIGHT=126 BORDER=0
ALT="Solar System" USEMAP="#SystemMap">
<MAP NAME="SystemMap">
<AREA SHAPE="rect" COORDS="0,0,82,126"
HREF="/workshop/graphics/sun.gif">
<AREA SHAPE="circle" COORDS="90,58,3"
HREF="/workshop/graphics/merglobe.gif">
<AREA SHAPE="circle" COORDS="124,58,8"
HREF="/workshop/graphics/venglobe.gif">
<AREA SHAPE="circle" COORDS="162,58,10"
HREF="/workshop/graphics/earglobe.gif">
<AREA SHAPE="circle" COORDS="203,58,8"
HREF="/workshop/graphics/marglobe.gif">
<AREA SHAPE="poly" COORDS="221,34,238,37,257,32,278,44,284,60,
281,75,288,91,267,87,253,89,237,81,229,64,228,54"
HREF="/workshop/graphics/jupglobe.gif">
<AREA SHAPE="poly" COORDS="288,19,316,39,330,37,348,47,351,66,
349,74,367,105,337,85,324,85,307,77,303,60,307,50"
HREF="/workshop/graphics/satglobe.gif">
<AREA SHAPE="poly" COORDS="405,39,408,50,411,57,410,71,404,78,
393,80,383,86,381,75,376,69,376,56,380,48,393,44"
HREF="/workshop/graphics/uraglobe.gif">
<AREA SHAPE="poly" COORDS="445,38,434,49,431,53,427,62,430,72,
435,77,445,92,456,77,463,72,463,62,462,53,455,47"
HREF="/workshop/graphics/nepglobe.gif">
<AREA SHAPE="circle" COORDS="479,66,3"
HREF="/workshop/graphics/pluglobe.gif">
</MAP>