0% found this document useful (0 votes)
80 views2 pages

HTML Links - The Target Attribute

The document discusses the target attribute in HTML links. It explains that the target attribute specifies where linked documents will open, such as in the same frame, a new tab, or new window. It provides an example of using target="_blank" to open a link in a new browser tab or window. It also lists different target values and their descriptions.

Uploaded by

Shubham Alavni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views2 pages

HTML Links - The Target Attribute

The document discusses the target attribute in HTML links. It explains that the target attribute specifies where linked documents will open, such as in the same frame, a new tab, or new window. It provides an example of using target="_blank" to open a link in a new browser tab or window. It also lists different target values and their descriptions.

Uploaded by

Shubham Alavni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>

<html>

<body>

<a href="http://www.w3schools.com" target="_blank">Visit W3Schools.com!


</a>

<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>

HTML Links - The target Attribute


The target attribute specifies where to open the linked document.

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

Target Value Description

_blank Opens the linked document in a new window or tab

_self Opens the linked document in the same frame as it was clicked (this is default)

_parent Opens the linked document in the parent frame

_top Opens the linked document in the full body of the window

framename Opens the linked document in a named frame

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>

You might also like