Role of the target="_blank" Attribute in <a>
The target="_blank" attribute in the <a> (anchor) tag is used to open the linked document in a new browser tab or window. This allows users to view the new page without leaving the current one.
It tells the browser to open the hyperlink in a new tab or window.
Useful for keeping the current page open while navigating to external sites.
Should be used carefully, as too many new tabs can annoy users.
For security, it’s best practice to also add rel="noopener noreferrer" when using target="_blank".
In short: target="_blank" makes a link open in a new tab or window, often combined with rel="noopener noreferrer" for security.
You need to add a link to an external article that should open in a new tab. How would you write the HTML?
If you forget to include target="_blank" on that link, what will the user experience be?
What attribute would you add to make sure the new tab can't access the original page's window object?
A bug report says that links with target="_blank" are sometimes opening in the same tab after a recent JavaScript refactor. How would you investigate and fix it?
Explain the trade‑offs between using target="_blank" for external links versus handling navigation through your SPA router.
Your design system requires all external links to open in a new tab but also to be safe from reverse tabnabbing. How would you implement that in the component?
You are building a reusable Link component used across dozens of services. Describe how you would enforce security best practices while keeping the API simple.
Discuss the performance and SEO implications of using target="_blank" at scale, and how you would monitor any negative impact.
How would you design a lint rule or CI check to prevent missing rel attributes on target="_blank" links in a large codebase?
Your organization is migrating legacy HTML pages to a component library. What strategy would you use to replace inline target="_blank" links with a standardized, secure approach without breaking existing analytics?
Across multiple product teams, there is disagreement about opening external links in new tabs. How would you lead a cross‑team policy decision, considering accessibility, security, and user experience?