_blank vs blank in anchor tag ⚓️

Yes !!! you read it correct. We have two variants of blank available in html for anchor ⚓️ tag.

Let’s understand first how _blank works. If we want to open a url in new tab always, whenever it is clicked by the user then we add target="_blank" in our anchor tag just like this:

The behaviour of above line will just like this:

Now, let’s see how does blank behaves. Consider following code:

Whenever above code executed in browser, and the anchor ⚓ ️ tag is clicked by user 👤, the link will be opened in new tab first time only, and after that, every other click will just replace the tab with the new url.

Let’s understand this by watching 👀 an example:

In above demonstration, when we clicked Google first time, google opened in new tab, and after that every other link just replace the new tab.

I hope it helped you learn something new about anchor tags.

Cheers !!!
🍻

--

--