You are here: Reference > HTML > attributes > target (a, area, base, form, link)

target attribute (a, area, base, form, link)

Browser support:
Specifies the target window or frame where the document is to be opened.
JavaScript page for this attribute: target. You can find other example(s) there.

Possible values:

String that identifies the target window.
One of the following values:
_blank
Indicates a new window.
_media
Indicates the HTML content area of the Media Bar.
_parent
Indicates the parent frame.
_search
Indicates the browser search panel.
_self
Default. Indicates the frame containing the source link.
_top
Indicates the topmost window.
Target name
The name of the target window or frame (frame or iframe). If there is no window or frame with the specified name opened for the current document, a new window will be opened, otherwise the target references the matching window.
Default: _self.

Example HTML code 1:

This example illustrates the use of the target attribute:
Code
frame.htm
<a id="myAnchor" href="frame.htm" target="TargetFrame">Click on it!</a>
<iframe name="TargetFrame" src="" height="150px" width="200px"></iframe>
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content