Learn html - html tutorial - Target attribute in html - html examples - html programs
For <a> (anchor)elements and <area> elements, the target attribute defines where to open the linked document.
For <base> element, the target attribute defines the default target for all hyperlinks and forms in the page.
For <form> element, the target attribute describes a name or a keyword that specifies where to show the response that is received after submitting the form.
Syntax for target attribute in HTML:
<a target="value">
Differences between HTML 4.01 and HTML5 for target attribute:
HTML 4.01
The target attribute is depreciated.
HTML 5
The target attribute is supported.
Applies To:
Attribute Values:
Value
Description
_blank
Opens the linked document in a new window.
_parent
Opens the linked document in the parent frame
_self
Opens the linked document in the same frame as it was clicked
framename
Opens the linked document in a named frame
_top
Opens the linked document in the full body of the window
Sample Coding for target Attribute in HTML:
Tryit<!DOCTYPE html>
<html >
<body>
<p> Open the link in a new tab:
<a href="http://www.wikitechy.com" target="_blank"> Hi Wikitechy!
</a>
</p>
</body>
</html>
Code Explanation for target Attribute in HTML:
<a> tag specifies a hyperlink, that is used to link “wikitechy.com”.
href defines the URL of the page goes to that “wikitechy.com” .
target attribute defines the target for open the wikitechy.com document in a new window because the value of the target is _blank.
Output for target Attribute in HTML:
The output shows a “Hi Wikitechy” link.
Browser Support for target Attribute in HTML:
Tips and Notes
Frames and framesets are no longer supported.
The _parent, _top and framename attribute values are mainly used with iframes.
Related Searches to target Attribute in html
target Attribute
target=_parent
html target framename
html target popup
a href target new tab
target _blank not working
tag and target lakewood
target _blank css
target _blank vulnerability
html attributes
html tutorials html editor html code html form html tutorial html color html color codes html table html img html5 html code for website html and css html programs html website free html editor html5 tutorial wysiwyg html editor html tutorial pdf html converter php tutorial html example html tutorial css tutorial html css html tags html basics code html html online html mailto html lang html tags list