Browser Support:
Chrome , Edge , Firefox, Safari ,Opera.
target=”_blank”
This Code allow you to open a link in a new window.
<!DOCTYPE html>
<html>
<head>
<title>_blank</title>
</head>
<body>
<a href="http://www.google.com" target="_blank">google.com</a>
</body>
</html>
target=”_self” , target=”_parent”
You can see the difference between _self and _parent only if you use iframe inside the parent html.
target=”_self”
Same thing without target
Iframe code:
<!DOCTYPE html>
<html>
<head>
<title>_parent</title>
</head>
<body>
<iframe src="index.html" frameborder="0" style="border:1px solid red"></iframe>
</body>
</html>
index.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
<a href = "http://www.google.com" target="_self" >self</a>
</div>
</body>
</html>
target=”_parent”
Open the link in the parent window.
Iframe code:
<!DOCTYPE html>
<html>
<head>
<title>_parent</title>
</head>
<body>
<iframe src="index.html" frameborder="0" style="border:1px solid red"></iframe>
</body>
</html>
index.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
<a href = "http://www.google.com" target="_parent" >parent</a>
</div>
</body>
</html>