Difference between "blank" and "_blank" target attributes in HTML - GeeksforGeeks

03 Aug, 2021
If you have ever noticed on the website that few links got opened either in a new tab or in a new window or sometimes, it might also happen that in some websites, click on the link, for the first time, it will open in a new tab & that particular open tab will update & reused every time whenever we click to the link. Both these scenarios can be possible by using the HTML target attribute. In this article, we will see how to use of target=”blank” & target=”_blank” attribute to open a hyperlink in another tab. If you don’t know, please refer to How to open a hyperlink in another window or tab in HTML?. We will discuss both attributes one-by-one. Let’s first see target=”blank”.
1. target=”blank”: if we set the target as “blank” then after clicking on a link or after submitting a form, it’s going to open a browser tab for the first time and it will be reused the same tab. The purpose of using this attribute is to keep the user engagement on your website without much effort to search & visit the offsite link every time in a separate tab. It also helps the user’s browser light to use as too many open tabs might hamper the performance of the overall browser as well as affect the system & it is also possible that the browser may get hanged up.
Example:
HTML
<!DOCTYPE html><html>  <head>    <title>target="blank"</title></head>  <body>      <!-- It will open a new browser         tab for the first time and         after that it will reuse         that open tab -->    <p>Using target="blank"</p>      <a href="https://www.geeksforgeeks.org/"         target="blank">        Open GFG    </a></body>  </html>
Output:
Using target=”blank”
From the above output, we can see that on click the link for the first time, it will open in the new tab & every time whenever we click on the same link, it will redirect to that particular open tab.
2. target=”_blank”: if we set the target as “_blank” then after clicking on a link or after submitting a form it’s going to open a  new browser tab every time. The purpose of using this attribute is to keep the users engaged on your site for a long time that will improve most of your metrics: bounce rate, conversion, pages visited etc.
Example:
HTML
<!DOCTYPE html><html>  <head>    <title>target="_blank"</title></head>  <body>      <!-- It will open a new browser         tab every time -->    <p>Using target="_blank"</p>      <a href="https://www.geeksforgeeks.org/"        target="_blank">        Open GFG     </a></body>  </html>
Output:
Using target=”_blank”
From the above output, we can see that whenever on click the link, it is targeting the new tab for each click.
To open the offsite link in a separate tab for the first time & keep on reuse the same tab whenever linked is clicked. 
To open the offsite link in the separate tab or window. 
Opens a new browser tab for the first time & after it will be reused. For this reason, the browser may work efficiently.
Opens a new browser tab every time. This may affect the overall performance of the browser as well as affect the system also.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
HTML-Attributes
HTML-Questions
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
REST API (Introduction)
Design a web page using HTML and CSS
Angular File Upload
Form validation using jQuery
How to auto-resize an image to fit a div container using CSS?
Roadmap to Become a Web Developer in 2022
Installation of Node.js on Linux
How to fetch data from an API in ReactJS ?
Convert a string to an integer in JavaScript
How to calculate the number of days between two dates in javascript?