Area Object
The coords property sets or returns the value of the coords attribute of an area.
The coords attribute specifies the x and y coordinates of an area.
Tip: The coordinates of the top-left corner of an area are 0,0.
The coords property can have 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 corner and the bottom-right corner of the rectangle |
| x,y,radius | If the shape attribute is set to "circle", it specifies the coordinates of the circle center and the radius |
| x1,y1,x2,y2,..,xn,yn | If the shape attribute is set to "poly", it specifies the coordinates of the edges of the polygon. If the first and last coordinate pairs are not the same, the browser must add the last coordinate pair to close the polygon |
![]()
The coords property is supported in all major browsers.
Return the coordinates for the "Venus" area in the image-map:
The output of the code above will be:
Area Object
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|