Difference between “blank” and “_blank” target attributes in HTML
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.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
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.
From the above output, we can see that whenever on click the link, it is targeting the new tab for each click.
Differences between target=”blank” and target=”_blank”.
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.