Horje
How to create HTML Links The target Attribute

By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.

The target attribute specifies where to open the linked document.

The target attribute can have one of the following values:

  • _self - Default. Opens the document in the same window/tab as it was clicked
  • _blank - Opens the document in a new window or tab
  • _parent - Opens the document in the parent frame
  • _top - Opens the document in the full body of the window

Full Example of HTML Links The target Attribute

Use target="_blank" to open the linked document in a new browser window or tab:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>The target Attribute</h2>

<a href="https://itupto.com/" target="_blank">Visit Itupto!</a> 

<p>If target="_blank", the link will open in a new browser window or tab.</p>

</body>
</html>

Output should be:

Full Example of HTML Links The target Attribute




Related Articles
What is HTML Links HTML Links
How to create HTML Links - Syntax HTML Links
How to create HTML Links The target Attribute HTML Links
What is Absolute URLs vs. Relative URLs HTML Links
How to use an Image as a Link HTML Links
How to use Link to an Email Address HTML Links
How to create Button as a Link HTML Links
How to use a title in Link HTML Links

Single Articles
Full Example of HTML Links The target AttributeHTML Links

Read Full:
HTML Links
Category:
Web Tutorial
Sub Category:
HTML Links
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
4
Ref on:
View



Share on: