Area shape attribute
Definition and usage
shape
Attribute sets or returns the area's shape attribute value.
shape
Attribute defines the shape of the area.
shape
Attribute with coords attribute Used together to define the size, shape, and position of the area.
Hint:Please use coords attribute Set or return the area's coords attribute value.
Instance
Example 1
Change the shape of a specific area in the image mapping:
document.getElementById("venus").shape = "default";
Example 2
Get the shape of a specific area in the image mapping:
var x = document.getElementById("venus").shape;
Syntax
Return the shape attribute:
areaObject.shape
Set the shape attribute:
areaObject.shape = "default|rect|circle|poly"
Attribute value
Value | Description |
---|---|
default | Define the entire area. |
rect | Define a rectangular area. |
circle | Define a circular area. |
poly | Define a polygonal area. |
Technical Details
Return Value: | A string value that represents the shape type of the area. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
Related Pages
HTML Reference Manual:HTML <area> shape Attribute