Example
Change the shape for a specific area in an image-map:
document.getElementById("venus").shape = "default";
Try it Yourself »
Definition and Usage
The shape property sets or returns the value of the shape attribute of an area.
The shape attribute specifies the shape of an area.
The shape attribute is used together with the coords attribute to specify the size, shape, and placement of an area.
Tip: Use the coords property to set or return the value of the coords attribute of an area.
Browser Support
Property | |||||
---|---|---|---|---|---|
shape | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the shape property:
areaObject.shape
Set the shape property:
areaObject.shape="default|rect|circle|poly"
Property Values
Value | Description |
---|---|
default | Specifies the entire region |
rect | Defines a rectangular region |
circle | Defines a circular region |
poly | Defines a polygonal region |
Technical Details
Return Value: | A String, representing the shape type of the area |
---|
More Examples
Example
Get the shape of a specific area in an image-map:
var x =
document.getElementById("venus").shape;
The result of x will be:
circle
Try it Yourself »
Related Pages
HTML reference: HTML <area> shape attribute
< Area Object