W3Schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPJQUERYBOOTSTRAPANGULARXML
 

Area target Property

Area Object Reference Area Object

Example

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

document.getElementById("venus").href = "_blank";

Try it yourself »

Definition and Usage

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

The target attribute specifies where to open the linked document.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The target property is supported in all major browsers.


Syntax

Return the target property:

areaObject.target

Set the target property:

areaObject.target="_blank|_self|_parent|_top|framename"

Value Description
_blank Open the linked document in a new window
_self Open the linked document in the same frame as it was clicked (this is default)
_parent Open the linked document in the parent frameset
_top Open the linked document in the full body of the window
framename Open the linked document in a named frame

Technical Details

Return Value: A String, representing where to open the linked document

More Examples

Example

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

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

The result of x will be:

_self

Try it yourself »

Related Pages

HTML reference: HTML <area> target attribute


Area Object Reference Area Object