cold
cold

Reputation: 31

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

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>

Upvotes: 2

Views: 766

Answers (3)

Moti Salamon
Moti Salamon

Reputation: 162

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>

Upvotes: 2

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>

Upvotes: 3

Gisbert12843
Gisbert12843

Reputation: 122

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

Upvotes: 0

Related Questions