Ask any question about HTML here... and get an instant response.
How can I create a hyperlink that opens in a new tab?
Asked on Oct 31, 2025
Answer
To create a hyperlink that opens in a new tab, you use the
<a> tag with the target attribute set to _blank. 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 practice for external links. - Consider adding
rel="noopener noreferrer"for security reasons when usingtarget="_blank".
✅ Answered with HTML best practices.
Recommended Links:
