If you have a link on your website that goes to a different website, then you will want the page to open in a new window. By having the page open in a new window, your visitor will not leave your website and can easily go back to it once they are done at the site that you linked to. This is a great way to keep visitors on your website when you want to have a link to a different site.
For reference, this is the same HTML code we used in a previous section to make a hyperlink:
<a href="/help/nextpage.html">Click here to go to my next page</a>
The basic form is the same, but we need to change a few things. First, we will change the link that the text is pointed to. When a link is pointed to your own site you only need the name of the file on your server, but if you are pointing the link to a different website then the full link is needed with the http://. For example:
<a href="http://www.differentwebsite.com">Click here to go to my next page</a>
If you used the link as we have above, it would go to the new website, but it would stay in the same window and take your visitor away from your site. To change this, we can change the "target" of the link. The target attribute allows you to tell the page where to open the new link. To open the page in a new window, we will use the target attribute _blank. As it sounds, this tells the link to open in a blank page, instead of of the same page. It will look like this:
<a href="http://www.differentwebsite.com" target="_blank">Click here to go to my next page</a>
Now we will just change the text of the link:
<a href="http://www.differentwebsite.com" target="_blank">Click here to visit a different site with more information!</a>
And you have created a link that will open in a new window!