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

Area alt Property

Area Object Reference Area Object

Example

Get the alternate text of a specific area in an image-map:

var x = document.getElementById("venus").alt;

The result of x will be:

A beautiful planet

Try it yourself »


Definition and Usage

The alt property sets or returns the value of the alt attribute of an area.

The required alt attribute specifies an alternate text for an area, if the image cannot be displayed.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The alt property is supported in all major browsers.


Syntax

Return the alt property:

areaObject.alt

Set the alt property:

areaObject.alt=text

Property Values

Value Description
text The alternate text for the area

Technical Details

Return Value: A String, representing an alternate text for the area


More Examples

Example

Change the alternate text for a specific area in an image-map:

document.getElementById("venus").alt = "The planet Venus";

Try it yourself »


Related Pages

HTML reference: HTML <area> alt 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 HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook