Horje

How to create HTML <a> target Attribute

The target attribute specifies where to open the linked document.

Definition and Usage

The target attribute specifies where to open the linked document.

Browser Support

Syntax

<a target="_blank|_self|_parent|_top|framename">

Attribute Values

Value Description
_blank Opens the linked document in a new window or tab
_self Opens the linked document in the same frame as it was clicked (this is default)
_parent Opens the linked document in the parent frame
_top Opens the linked document in the full body of the window
framename Opens the linked document in the named iframe
index.html
<!DOCTYPE html>
<html>
<body>

<h1>The a target attribute</h1>

<p>Open link in a new window or tab: <a href="https://horje.com" target="_blank">Visit Horje!</a></p>

</body>
</html>

Output should be:

How to create HTML <a> target Attribute




Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin