HTML target="_self"

A target="_self" attribute value specifies that the target page will be opened in a same browser tab and window as the current page. The target page can be a linked page or a response to a form submission.

Example

#

A target="_self" on an <a> tag.
Clicking the link will open the linked page in the same browser tab as the current page.

Go to <a target="_self" 
         href="/html/">HTML Tutorial</a>

Using target="self"

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

The target="_self" value opens the page in the same tab, window, or frame as the current page.

By default, links are displayed in the same tab and window as the current page.

Therefore, omitting target="_self" has the same effect as including it.


Syntax

<tagname target="_self" />

Elements that accept target

These elements accept the target attribute with a _self value.

Elements Description
<a> Specifies an anchor link -- see example above
<area> Creates clickable areas inside an image map.
<base> Sets the base URL for all relative URLs on a page or site..
<form> Specifies an HTML form.

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

Guides