HTML target=_blank vs target=blank

HTML target=_blank vs target=blank

Jun 18, 2021ยท

2 min read

Earlier I thought they both perform the same actions like opening a link to a new tab (or window ) in the browser. But, just removing the underscore can make an important difference.

The target attribute specifies where to open the linked document.


<a href="" target="_blank">Visit google Site</a>

With target=_blank,

Whenever we click the link, it will open in a new tab. So, let's say if we click more links then, every time a new browser tab will open which can create multiple tabs, and maybe it can frustrate the user and its experience.

target _blank example

Alternate solutions we can use target=blank,

Now, let's remove the underscore, then the browser will open the link in a tab called 'blank' instead of opening a new one. With this, if the user will click multiple links then the links will open in a single tab.


<a href="" target="blank">Visit google Site</a>

target blank example


{% codepen %}


๐Ÿ‘๐Ÿ‘ By coming this far I hope you can implement this awesome target attribute trick on your project. So, I suggest you give it a try on your project and enjoy it!

Feel free to share your thoughts and opinions and leave me a comment if you have any problems or questions.

Till then, Keep on Hacking, Cheers