Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open link in new browser window

Status
Not open for further replies.

agape234

Programmer
Oct 10, 2001
128
US
How do I set a links to open a new browser window.
I want all my "frame" links to open in a new browser window, not in the main or frame set window.
 
yea in your anchor tag put "target=_blank" ie:
Code:
<a href='whatever.html'
Code:
target='_blank'
Code:
>

hope this helps &quot;Those who dare to fail miserably can achieve greatly.&quot; - Robert F. Kennedy
So true..
 
I am new to HTML and trying to this using just a text editor, but where exactily would this statement be included? Where is the anchor tag?
 
This works excellent for each individual link, but is there a way that I can specify that all links on a page will open a new brwoser window? Without adding this statement to each individual link?
 
put this in the <head> part of your document:
Code:
<Script language='javascript'><!--
function changeLinkTarget()
{
links = document.links;
for (x=0;x<links.length;x++)
	{
	links[x].target = '_blank';
	}
}
//--></script>

and in your <body> tag, put this little snippet of code:
Code:
onload='changeLinkTarget()'

hope it helps!
&quot;Those who dare to fail miserably can achieve greatly.&quot; - Robert F. Kennedy
So true..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top