onclick of a <a> tag, open in new tab another html file

Viewed 110

When the tag is clicked, I want it to open another .html file (for example could be called discussions.html) in another tab.

<!DOCTYPE html>
<html>
<head>
<body>

<a href="<!--I don't know what to put here pls help-->">open new html file</a>


</body>
</head>
</html>

3 Answers

You just have to set the target of the link to blank, that's all. See below:

<html>
<head>
<body>

<a href="discussions.html" target="_blank">DISCUSSIONS</a>

</body>
</head>
</html>

If you want to open link in a new tab:

<a href="https://example.com" target="_blank">some text</a>

Or for page in your domain:

<a href="example.html" target="_blank">some text</a>

You would want to put a link inside there ^^

e.g. /dist/discussion.html" if you want to make it point on another one of your websites in this project

or http://google.com if you want it to redirect to another existing site

Related