Availability: |
| |||||||
Property/method value type: | String primitive | |||||||
JavaScript syntax: | - | myUrl.target | ||||||
- | myUrl.target = aTarget | |||||||
HTML syntax: | <A TARGET="..."> <LINK TARGET="..."> | |||||||
Argument list: | aTarget | The name of a new target window or frame |
This property yields the value of the TARGET attribute in an <A>, <AREA> or <MAP> tag if there is one and an empty string if not.
You can assign a new value to this property so that the URL will be directed to a different window or frame.
Here are some example target values:
_parent
_self
_top
_blank
Window name
Frame name
Netscape version 6.0 adds the _content target value for use within HTML that exists in the sidebar area. This ensures that the link is targeted at the main window and does not overwrite the sidebar.
<HTML> <HEAD> </HEAD> <BODY> <A NAME="EXAMPLE" HREF="http://www.mydomain.com:8080/folder/file.html#abcdef" TARGET="_top">Click here</A><BR> <SCRIPT> document.write(document.links[0].target); </SCRIPT> </BODY> </HTML>
Prev | Home | Next |
Url.shape | Up | Url.text |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |