Home Tutorial Html Html5 Target attribute in anchor tag, Use of target attribute of anchor tag in HTML5.

 
 

Share on Google+Share on Google+
Target attribute in anchor tag, Use of target attribute of anchor tag in HTML5.
Posted on: August 31, 2010 at 12:00 AM
Advertisement
In this section, we will see the use of target attribute of anchor tag in HTML5.

Target attribute in anchor tag, Use of target attribute of anchor tag in HTML5.

In this tutorial, we will see the use of target attribute of anchor tag in HTML5. Target attribute tells the browser where to display linked document. There are four defined targets. Each target starts with an underscore("_").
_blank, _parent, _self, _top.

Target Attribute :
Attribute Value Description
target _blank
_self
_parent
_top
linked document will be display in new window.
linked document will be display in current window.
linked document will be display in current frameset.
linked document will be display in main browser window. 


Declaration Syntax :

Declaration syntax of target attribute in anchor tag.

                  <a  href="value" target="value">Text Area</a>

Example of target attribute:

Code:

hrefAttributeTag.html

<!DOCTYPE html>
<html>
<head>
<title>Write title of document.</title>
</head>
<body>
<p>Target attribute of anchor tag in HTML5.</p>
<ul>
<li>
<a href="http://www.roseindia.net/" target="_blank">
Open in 
new window.</a>
</li>
<li>
<a href="http://www.roseindia.net/" target="_self">
Open in current window.</a>

</li>
</ul>
</body>
</html>
Output:

 

Note: See the browser compatible page for successfully rendering the program.

Download this code

Advertisement

Related Tags for Target attribute in anchor tag, Use of target attribute of anchor tag in HTML5.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 31, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com