Area target attribute
Definition and usage
target
Sets or returns the target of the area target attribute value.
target
The attribute specifies the location where the linked document is opened.
Example
Example 1
Change the target of a specific area in the image map:
document.getElementById("venus").target = "_blank";
Example 2
Get the target of a specific area in the image map:
var x = document.getElementById("venus").target;
Syntax
Return the target attribute:
areaObject.target
Set the target attribute:
areaObject.target = "_blank|_self|_parent|_top|framename"
Attribute value
Value | Description |
---|---|
_blank | Open the linked document in a new window. |
_self | Open the linked document in the same frame when clicked (default). |
_parent | Open the linked document in the parent frame set. |
_top | Open the linked document in the entire window. |
framename | Open the linked document in the named frame. |
Technical Details
Return Value: | A string value representing the location where the linked document is to be opened. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
Related Pages
HTML Reference Manual:HTML <area> target Attribute