1. Home
  2. Computing & Technology
  3. Web Design / HTML

How to Open a Link in a New Window: Using Frames

Part 2: Targeting to Open a New Window

By Jennifer Kyrnin, About.com

One of the side benefits that came out of the frames HTML is the ability to open a link in a brand new page. Using the target attribute will open the link as a full-sized, fully-functional new window.

Normally, you use the target attribute (of the anchor (a) tag) to open links in a frame already on the Web page. The frames are named in the frameset, and the target then opens the link in the named frame.

But if you target a frame that doesn't exist, the browsers will open a brand new browser Window. For example, you can target a frame called "new_page". Because that frame name doesn't exist, the browser will open the link in a new window, and call that window "new_page".

    <a href="/library/weekly/aa030600a.htm" target="new_page">

Every link that is targeted to the "new_page" window will open in the same new window.

If you want every link you write to open in a different new window, you could give them all different names, or you could use the special target "_blank". If you put the tag<base target="_blank">in the head of your page, all links on that page will open in a new window.

Next Page > Using JavaScript > Page 1, 2, 3

Previous Features

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2008 About.com, a part of The New York Times Company.

All rights reserved.