Question:
How do you program a link to open in a new tab?
_Zith
2011-08-25 15:39:25 UTC
I'm working with Google Sites. It's real good in some ways, but limiting in others...

I need to include a link to another website. I've been asked to make it open in a new tab/window, rather than directing the entire page away from our site, but that isn't a "point and click" option within google sites.

What are some work arounds that would open a link in a new tab for me?
Five answers:
2011-08-25 17:19:50 UTC
Web sites have no control over how a viewer's clicked on links will open. These are options set within the browser. Plus, anyone can right click on a link and select from the Context Menu whether to open in new window or tab.



Use of the target attribute, as other Answerers have given, are incorrect. The target attribute always gets used incorrectly because browser developers never got it correct and bad habits in its use have developed over the years.



Ron
?
2011-08-25 15:44:26 UTC
When you create a link you use the tag to do so but what you need is the target attribute to be set to "_blank". here is an example:



Link



UPDATE:



Damn somebody beat me to it.



ANOTHER UPDATE THAT ACTUALLY ANSWERS YOUR PROBLEM:



LOL I didn't necessarily know that you were using google sites. There is a checkbox at the bottom of the editor when adding a link that says "Open in New Window". You want to check that. Don't worry it will open in new tab not a new window.
Bob Diamond
2011-08-25 15:42:30 UTC
Okay, This is how.



1> Right Click on Link.

2> Scroll Down to Open in New Tab or Open in New Web Page

3> Done!
2016-02-28 03:07:00 UTC
install tab mix plus firefox extension. u will find new options that will open EVERY link in a new tab and does not switch over it.
2011-08-25 15:43:06 UTC
use this as a html snipit.



just replace someurl with your url





This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...