Because I want eblace to open in the same tab, I have not added any target, since it is assumed that "_self" is the default one. However, only with this code, does not open any link:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body
{
min-width:360px;
}
a{
color:#009900;
text-decoration:none;
}
a:hover
{
text-decoration:underline;
}
h1
{
font:1.5em sans-serif;
color:#fff;
background:#006600;
padding:5px
}
</style>
</head>
<body>
<h1>Abre</h1>
<a href="www.youtube.com" >YT</a>
</body>
</html>
I have tried to put onclick="window.open(this.href)"
after the link, but that has not solved the problem. I know the problem is not the link itself, since putting traget="_blank"
opens. The problem is that in this way opens in another tab and I would like to do it in it. What can I do to make the link open and do it on the same tab?