How to HTML open link in new in tab in browser

We can add this target=”_blank” in the <a> tag to open link in new tab

<!-- Opens in the same tab -->
<a href="https://en.wikipedia.org/wiki/Main_Page">Visit Wikipedia (same tab)</a>

<!-- Opens in a new tab -->
<a href="https://en.wikipedia.org/wiki/Main_Page" target="_blank">Visit Wikipedia (new tab)</a>

Example code


<!DOCTYPE html>

<head>

</head>
<body>


<!-- Opens in the same tab -->
<a href="https://en.wikipedia.org/wiki/Main_Page">Visit Wikipedia (same tab)</a>

<br>

<!-- Opens in a new tab -->
<a href="https://en.wikipedia.org/wiki/Main_Page" target="_blank">Visit Wikipedia (new tab)</a>

</body>
</html>