
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Specify Target for 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>
Advertisements