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





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


Read Article
https://develop.horje.com/learn/1434/reference