Html tag to open link in new tab
The HTML tag to open a link in a new tab is:
target="_blank"
You can add this attribute to the a
tag, like this:
<a rel="nofollow" target="_blank" href="https://www.example.com" target="_blank">Visit Example.com</a>
This will open the link in a new tab or window when the user clicks on it.
Note that you can also use target="_new"
or target="_noopener"
instead of _blank
, but _blank
is the most commonly used and supported option.
Also, you can use rel="noopener"
attribute to prevent the new tab from accessing the parent page's context, which can help prevent security issues.
<a rel="nofollow" target="_blank" href="https://www.example.com" target="_blank" rel="noopener">Visit Example.com</a>
It's worth noting that some browsers may not support the target
attribute or may have different behavior when opening links in new tabs.