Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Area coords Property

Area coords Property

Area Object Reference Area Object


Definition and Usage

The coords property can set or return the value of the coords attribute of a region.

The coords attribute describes the coordinates of a clickable region in an image map.

**Note:** The upper-left corner of the region has coordinates 0,0.

Syntax

areaObject.coords=

value

The coords output can be the following values:

Value Description
x1,y1,x2,y2 If the shape attribute is set to "rect", it specifies the rectangle coordinates of the upper-left and lower-right corners.
x,y,radius If the shape attribute is set to "circle", it specifies the center coordinates and radius.
x1,y1,x2,y2,..,xn,yn If the shape attribute is set to "poly", it specifies the coordinates of the polygon. If the first and last coordinates are different, the browser must add a coordinate to close the polygon.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the coords property.


Example

Example

Returns the coordinates of the "Venus" region in the image map:

Runoob Tutorial(runoob.com) Venus

Coordinates of Venus:

The example above produces the following output:

Coordinates of Venus: 124,58,8

Try it »


Area Object Reference Area Object