How to Open a Link in a New Window

By default, HTML links will open the URL in the same window (active window). However, with TARGET attribute of HTML Link Tag, you can have the new document open in a new window, or if you are using frames, it will open in targeted frame.

<a href="http://www.w3c.org/" target="_blank">W3C Home Page</a>

When you click the above link , browser will open a new window and show w3c home page.

Link Target Attributes and Values

html-link-target

Open Hyperlink in a New Window

However you can use the TARGET attribute with Html frames . You can target a frame by a name that you have assigned it.

<frame src="myFrame.html" id="myFrame"> <a href="sample.html" target="myFrame">

In the above code, sample.html will open in MyFrame area.

More about HTML Frames and Target..HTML Frames