target (HTML attribute)
Example
Here, thetarget attribute for the a
element is set to "_top": <p>You can try our <a href="cakes.html" target="_top">lovely range
of cakes</a>.</p>
Description
The
target attribute is deprecated and its use as a
layout mechanism, like that of the frameset, is no longer common. However, if you do find yourself having to
maintain a frameset-based web site, you may need to open links in frames
or windows other than the one in which the source of the link
resides.
Value
The attribute can take any of the following values:
"_blank"loads content in a completely new window
"frame name"loads content in a frame with a custom name
"_parent"loads content in the parent
framesetfor the currentframe"_self"loads content in the same frame (This attribute isn’t normally required, as this is the default behavior unless the baseelement specifies otherwise. In that case, you’d need to override the specification using
"_self"; for example,<base target="searchresults"/>.)"_top"loads content in the top-level
frameset(in effect, the whole browser window), no matter how many nested levels down the currentframeis located
Compatibility
| IE | 5.5 | Full |
|---|---|---|
| 6.0 | Full | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
It causes no compatibility issues, and has excellent support across all tested browsers.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

