DEV Community

Ajit
Ajit

Posted on • Edited on

Answer: What is the difference between target=“_blank” and target=“blank”?

The difference between target="_blank" and target="blank" is that target="_blank" is a valid attribute in HTML, whereas target="blank" is not a valid attribute.

target="_blank" is used to specify that a link should open in a new tab or window when clicked. For example:

<a href="https://www.example.com" target="_blank">Visit Example.com</a>
Enter fullscreen mode Exit fullscreen mode

target="blank", on the other hand, is not a valid attribute and will not work. Browsers will ignore the target attribute altogether, and the link will open in the same tab or window as the current page.

It is important to use the correct syntax and attributes in HTML, as using invalid syntax can lead to unexpected results or errors.

Both target="_blank" && target="blank" will open new window or tab The difference is

target="_blank"

On every click, it will open in a new window.

target="blank"

On another (Multiple) clicks, it will Open in the same window that opened for the first click (reuses the same tab) It reuses

Top comments (1)

Collapse
 
sloan profile image
Sloan the DEV Moderator

Hi there, we encourage authors to share their entire posts here on DEV, rather than mostly pointing to an external link. Doing so helps ensure that readers don’t have to jump around to too many different pages, and it helps focus the conversation right here in the comments section.

If you choose to do so, you also have the option to add a canonical URL directly to your post.