Dofactory.com
Dofactory.com

HTML <area> target Attribute

The target attribute on an <area> tag specifies where to open the linked page when the area is clicked.

The link can be opened in the same tab, a new tab, or a new window.

Example

#

A target attribute on an <area> element.
Clicking the monitor area in the image will open a page in a new browser tab.

Computer monitor
<img src="/img/html/computer-map.png" alt="Computer" usemap="#computermap">

<map name="computermap">
  <area target="_blank" shape="rect" coords="253,142,16,2"
        alt="monitor" href="https://google.com/search?q=monitor">
</map>

Using target

The target attribute specifies where the linked page will be opened.

A Linked page or other resource can be opened in the same tab, a new tab, a new window, or an iframe.

If target is not set, the link will open in the same tab/window as the current page.

Note: The target attribute requires that href has a value.


Syntax

<tagname target="_self | _blank | _parent | _top | framename" />

Values

#

Value Description
_self Opens the page in the same tab/window. This is the default.
_blank Opens the page in a new tab.
_parent Opens the page in the parent iframe. In the same iframe if there is no parent.
_top Opens the page in the topmost part of the iframe. In the same iframe if there is no topmost.
framename Opens the page in a named iframe.

Browser support

Here is when target support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <area>

Author: Jack Poorte
Published: Jun 20 2021
Last Reviewed: Sep 30 2023


What's your favorite/least favorite part of Dofactory?


Guides