How To Open a Link In a New Window (HTML)

    

 

Opening a link in a new window is an effective way to keep your visitors on your site.  Links made to other websites should open in a new browser window so your users won't forget what site they were at originally. 

 

If you are using frames, each frame has a different name and you can tell a browser which frame to open your link in by specifying a target.  If you are using a webpage with no frames or if you simply want to open a link in a new window, use the following code: 

 

  • Use the code <a href="http://www.yourlinkpage.com" target="_blank">Link Text</a> The "_blank" section is telling the browser to open the link in a frame called "_blank".  Since there is no frame that can be named _blank, it will open your link in a new window.
 
Javascript can also be used to open links in new windows, however, javascript can cause errors if not programmed correctly and is generally not needed to perform simple tasks like this. 

 

 

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.