HTML Links - The Target Attribute
HTML Links - The Target Attribute
DOCTYPE html>
<html>
<body>
<p>If you set the target attribute to "_blank", the link will open in a new browser
window or a new tab.</p>
</body>
</html>
This example will open the linked document in a new browser window or in a new tab:
Example
<a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
Try it Yourself
_self Opens the linked document in the same frame as it was clicked (this is default)
_top Opens the linked document in the full body of the window
If your webpage is locked in a frame, you can use target="_top" to break out of the frame:
Example
<a href="http://www.w3schools.com/html/" target="_top">HTML5 tutorial!</a>