How to open a link in a new tab in HTML?
Add target="_blank" to the <a> tag. It is good to add rel="noopener" too, so that the new page cannot control your page through window.opener.
<a href="https://www.example.com" target="_blank" rel="noopener">Open in new tab</a>
Use it only when it is really needed, for example for external websites. Many visitors prefer to decide themselves. See HTML Links.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |