X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

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

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook