MSDN Library
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

target attribute | target property

Sets or retrieves the window or frame at which to target content.


HTML<element target="p" ... >

p =


Property values

Type: String


The name of the target window or frame.


For Windows Runtime apps using JavaScript only: Loads the linked document in the default browser. If the linked document is in the app's package, the link won't navigate to the document because the browser can't display documents contained in an app's package.


Load the linked document into the immediate parent of the document the link is in.


Default. Load the linked document into the window in which the link was clicked (the active window).


Load the linked document into the topmost window.


The window name is an optional argument in the open scripting method.

In a Windows Runtime app using JavaScript, if you set the target attribute to the name of an iframe, the iframe loads the linked document. If the specified target doesn't exist, the link opens in the default browser.

For more info about navigation in Windows Runtime apps using JavaScript, see Supporting navigation.


This example uses the target attribute to specify a link that loads the page into the topmost frame of the current frameset.

<a href="newpage.htm" target="_top">Go to  Page.</a>

See also




© 2015 Microsoft