Target Parent Window

In this example, an anchor tag, <A>, with only the HREF attribute, points to the reference page, target2.html.

When the viewer, therefore, clicks on the linked text: "Open," the content of target2.html replaces the content of parent1.html in the current browser window.

The code:
<A HREF="target2.html">Open</A> a new page in this window.
produces the following effect:
Open a new page in this window.

To fully demonstrate this and the following examples:


In this second example, the anchor tag, <A>, includes a TARGET tag with the HREF.
When the viewer clicks on the linked text: "Open", the content of target2.html is NOW displayed in a separate window from parent1.html. The user can, therefore, read both pages on his/her desktop concurrently.
The code:
<A HREF="target2.html" TARGET="2nd_wind">Open</A> a new window called 2nd_wind.
produces the following effect:
Open a new window called 2nd_wind.

In contrast to the first example:


We will now create a link from parent1.html to target3.html, a third file with TARGET="3rd_wind" exactly like we created a link to target2.html.
The code:
<A HREF="target3.html" TARGET="3rd_wind">Open</A> a new window called 3rd_wind.
produces the following effect:
Open a new window called 3rd_wind.

To continue with our illustration:


Our last link from parent1.html will be to target4.html, with TARGET="2nd_wind" exactly the same TARGET name we gave to target2.html.
The code:
<A HREF="target4.html" TARGET="2nd_wind">Replace</A> the content in the <B>First Child Window</B>!
produces the following effect:
Replace the content in the First Child Window!

Finally to complete this lesson:


Continue with this lesson, or
return
to the Table of Contents.
Last Updated: Dec. 13, 1998