HTML DOM Area objekt

Area object

The Area object represents the HTML <area> element.

Access Area object

You can access the <area> element using getElementById():

var x = document.getElementById("myArea");

Try it yourself

Create Area object

You can create an <area> element using the document.createElement() method:

var x = document.createElement("AREA");

Try it yourself

Area object properties

Properties Description
alt Set or return the alt attribute value of the area.
coords Set or return the coords attribute value of the area.
hash Set or return the anchor part of the href attribute value.
host Set or return the hostname and port parts of the href attribute value.
hostname Set or return the hostname part of the href attribute value.
href Set or return the href attribute value of the area.
noHref

Not supported in HTML5.

Set or return the nohref attribute value of the area.

origin Return the protocol, hostname, and port parts of the href attribute value.
password Set or return the password part of the href attribute value.
pathname Set or return the pathname part of the href attribute value.
port Set or return the port part of the href attribute value.
protocol Set or return the protocol part of the href attribute value.
search Set or return the query string part of the href attribute value.
shape Set or return the shape attribute value of the area.
target Set or return the target attribute value of the area.
username Set or return the username part of the href attribute value.

Standard properties and events

The Area object supports both standardPropertiesandEvents.

Related pages

HTML Reference Manual:HTML <area>-tagget