<a href="" target="">

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

The target attribute of the A element specifies the target frame of the link.


<a href="index.html" target="_top">linked text</a>

Attribute Value Explanation
target=" " _blank the linked page opens in the new window
_top the linked page opens in the entire window
_self the linked page opens in the same frame
_parent the linked page opens in the parent frame
frame name the linked page opens in the named frame

Example

target="_top" (The linked page opens in the entire window)

<p><a href="example_t01.html" target="_top">Entire window</a></p>

Output

Target _top

Example pagenew window

target="_self" (The linked page opens in the same frame)

<p><a href="example_t02.html" target="_self">Same frame</a></p>

Output

Target _self

Example pagenew window

target="_parent" (The linked page opens in the parent frame)

<p><a href="example_t03.html" target="_parent">Parent frame</a></p>

Output

Target _parent

Example pagenew window

About the parent frame

Parent frame

When you load the "child.html" into the B frame, the parent frame of the C frame becomes the B frame.

target="FrameName" (The linked page opens in the named frame)

<ul>
<li><a href="example_t04.html" target="top">B frame</a></li>
<li><a href="example_t04.html" target="main">C frame</a></li>
</ul>

Output

Target name

Example pagenew window