target="_blank"
Opens a new window and show the related data.
target="_self"
Opens the window in the same frame, it means existing window itself.
target="_top"
Opens the linked document in the full body of the window.
target="_parent"
Opens data in the size of parent window.
Below is an image showing nested frames and the effect of different target values, followed by an explanation of the image.
Imagine a webpage containing 3 nested <iframe>
aka "frame"/"frameset". So:
Then target attributes have these effects:
target="_self"
, the link targets frame 1 (i.e. the link targets the frame containing the link (i.e. targets itself))target="_parent"
, the link targets frame 2 (i.e. the link targets the parent frame)target="_top"
, the link targets the initial webpage (i.e. the link targets the topmost/outermost frame; (in this case; the link skips past the grandparent frame 3))
target="_top"
, the link also targets the initial webpage (i.e. again, the link targets the topmost/outermost frame)target="_blank"
, the link targets an auxiliary browsing context, aka a "new window"/"new tab"
target="_blank"
; use the rel="noopener"
attributeHere is a practical example of Anchor tag with different
Section 6.16 Frame target names in the HTML 4.01 spec defines the meanings, but it is partly outdated. It refers to “windows”, whereas HTML5 drafts more realistically speak about “browsing contexts”, since modern browsers often use tabs instead of windows in this context.
Briefly, _self
is the default (current browsing context, i.e. current window or tab), so it is useful only to override a <base target=...>
setting. The value _parent
refers to the frameset that is the parent of the current frame, whereas _top
“breaks out of all frames” and opens the linked document in the entire browser window.
Source: Stackoverflow.com