This method is not recommended as it requires JavaScript, but if you want to do this programmatically, you can use the window.open method and bind it to the click event.
That way, when the link is clicked, the window.open method will open the link in a new tab.
In this post, we've seen how to open links in a new tab in HTML. We've also seen how to open links in a new tab using JavaScript and binding to the click event.
Hopefully, this post has been useful to you.
Thanks for reading!
To learn more about web development, founding a start-up, and bootstrapping a SaaS, follow me on X!