THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Area shape Property

Area Object Reference Area Object

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

Internet Explorer Firefox Opera Google Chrome Safari

The shape property is supported in all major browsers.


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 Reference Area Object