
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How do we specify the target for where to open the linked document in HTML?
Use the target attribute to specify the target for where to open the linked document in HTML. Here are the values of the target attribute −
Attribute | Description |
---|---|
_blank | Opens the linked page in a new tab. |
self | Opens the linked page in the current tab. |
parent | Opens the linked page in a parent frame. |
top | Opens the linked page in the topmost frame. |
Example
You can try to run the following code to implement target attribute −
<!DOCTYPE html> <html> <head> <title>HTML target attribute</title> </head> <body> <h2>References</h2> <p>Refer the following <a href = "https://www.qries.com/questions.php" target = "_blank">website</a>.<br> The above link will open in a new tab.</p> </body> </html>
- Related Articles
- How to specify the target media within the document language with CSS
- How do we add document title in HTML?
- How to specify where a Tkinter window should open?
- How do we include a section in an HTML document?
- Set the relationship between the current document and the linked document in HTML
- Set the language of the linked document in HTML
- Why do we use DOCTYPES in HTML document?
- How to specify that the target will be downloaded when a user clicks on the hyperlink in HTML?
- How to specify the number of visible options for in HTML?
- How do we add the width in characters for in HTML?
- How to specify where to send the form-data when a form is submitted in HTML?
- How do we display the main content in the document in HTML5?
- How do we specify that the audio/video will start playing as soon as it is ready in HTML?
- Create HTML Document with Custom URL for the document in JavaScript
- How do we specify the buffer size when opening a file in Python?

Advertisements