Target Attribute

Overview

The target attribute indicates how to open the document linked. It can be opened in the same window, same or a specific frame.

Note: target is an optional attribute. If this option is not set, the links will open in the same window.

Syntax & Example

<a href="example.html" target="_self|_blank|_parent|_top">

For instance, if you are going to open a link in a new tab, the target attribute should read as follows

<a href="example.html" target="_blank">

Attribute Values

Attribute Value Description
_self Opens the linked document in the same frame as it was clicked. If the attribute is not set, this is the default browser option.
_blank Opens link in a new window or tab.
_parent Opens link in the parent frame.
_top Opens link in the full body of the window.