Easy Tutorial
❮ Prop Embed Height Prop Element Offsetleft ❯

Area coords Attribute


Definition and Usage

The coords attribute sets or returns the value of the coords attribute of an area.

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

Tip: The top-left corner of the area has coordinates 0,0.

Syntax

The coords output can be one of the following values:

Value Description
x1,y1,x2,y2 If the shape attribute is set to "rect", it specifies the coordinates of the top-left and bottom-right corners of the rectangle.
x,y,radius If the shape attribute is set to "circle", it specifies the center coordinates and the radius of the circle.
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 not the same, the browser must add the closing coordinates of the polygon.

Browser Support

All major browsers support the coords attribute.


Example

Return the coordinates of the "Venus" area in the image map:

The above example outputs:

❮ Prop Embed Height Prop Element Offsetleft ❯