Yowling Inc
Articles Web Design Articles Home
 
Use HTML to open a link in a new window
“How to open a new window in HTML.”
by Joe Duchesne

How to open a link in a new window. I have been asked this question many times and decided that I needed to write a short article that explains how this is done.

The basic HTML tag to link to another website is the anchor tag.
      <a href="http://sitename.com">Link text here</a>

The HTML to open a new window:
      <a href=”http://sitename.com”  target="_blank">Link text here</a>

There are a number of options you can put in the TARGET parameter of the anchor tag. They are as follows:

  • _blank – Opens a new window when the link is clicked on.
  • _parent – Will open a link in the original window that called the present window (using _blank)
  • _self – Default behaviour of clicking on a link. It opens the link in the current window.
  • _top – Allows you to break out of a frame

You now know how to open a new window using HTML