How can I create a hyperlink that opens in a new tab?
Asked on Oct 08, 2025
Answer
To create a hyperlink that opens in a new tab, use the
<a> tag with the target="_blank" attribute. This instructs the browser to open the link in a new tab.
<!-- BEGIN COPY / PASTE -->
<a href="https://www.example.com" target="_blank">Visit Example</a>
<!-- END COPY / PASTE -->Additional Comment:
- The
hrefattribute specifies the URL of the page the link goes to. - Using
target="_blank"is a common way to enhance user experience by not navigating away from the current page. - Consider adding
rel="noopener noreferrer"for security reasons to prevent the new page from accessing your page's window object.
✅ Answered with HTML best practices.
Recommended Links: