Horje
How to use the target attribute in the <a> Tag in HTML ?

The target Attribute in the <a> Tag is used to specify where the linked document should be displayed when the user clicks on the hyperlink. It controls the behavior of the link, determining whether the linked content should open in the same browser window, a new browser window, or a new tab. The target attribute accepts different values that define the target location.

Syntax

<a href="https://www.horje.com" target="_blank">
GeeksforGeeks
</a>

Attribute Values

Here are common values for the target attribute:

  • _blank: Opens the linked document in a new browser window or tab.
  • _self: Default behavior. Opens the linked document in the same window or tab.
  • _parent: Opens the linked document in the parent frame.
  • _top: Opens the linked document in the full body of the window.

Example: Implementation of the target attribute in HTML.

HTML
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0">
    <title>Numbering</title>
</head>

<body>
    <a href="/tag" 
       target="_blank">GeeksforGeeks
      </a>
</body>

</html>

Output:


html-target-attribute

traget attribute in HTML




Reffered: https://www.geeksforgeeks.org


HTML

Related
How to include External CSS in an HTML Document ? How to include External CSS in an HTML Document ?
What is the purpose of the colspan attribute in a HTML Table ? What is the purpose of the colspan attribute in a HTML Table ?
How do you create a numbered list in HTML 5 ? How do you create a numbered list in HTML 5 ?
Explain the difference between head Tag and header Tag in HTML5 ? Explain the difference between head Tag and header Tag in HTML5 ?
HTML Table Borders HTML Table Borders

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
15