Problem Statement
Which target attribute value opens a link in a new browser tab?
Explanation
The target attribute with the value underscore blank opens the link in a new browser tab or window. This is useful when you want users to stay on your current page while viewing the linked content. The target attribute has several values. Underscore self opens the link in the same frame or tab, which is the default behavior. Underscore parent opens the link in the parent frame. Underscore top opens the link in the full body of the window, breaking out of any frames. When using target equals underscore blank, it is a good practice to also add rel equals noopener noreferrer for security reasons. This prevents the new page from accessing your page's window object.
Code Solution
SolutionRead Only
<!-- Opens in new tab --> <a href="https://example.com" target="_blank">Visit Example</a> <!-- Opens in same tab (default) --> <a href="about.html" target="_self">About</a> <!-- Best practice with security --> <a href="https://external-site.com" target="_blank" rel="noopener noreferrer">External Link</a>
