Page 1 of 1 [ 5 posts ] 

TallyMan
Veteran
Veteran

User avatar

Joined: 30 Mar 2008
Gender: Male
Posts: 40,061

28 Oct 2011, 10:38 am

Is there a HTML tag for opening an URL in a new tab/window instead of it just opening in the current tab? Or is some script required?

i.e. what would the following be replaced with to open a new tab/window?

<a href="http://www.somedomain.com">Some Domain</a>


_________________
I've left WP indefinitely.


DC
Veteran
Veteran

User avatar

Joined: 15 Aug 2011
Age: 45
Gender: Male
Posts: 1,477

28 Oct 2011, 10:44 am

do a google search for target attribute.

target ="_blank" will get the link to open in a new window, except for all the people with pop-up blockers...

Some browsers will by open up a new tab instead.



Dilbert
Veteran
Veteran

User avatar

Joined: 29 Mar 2009
Age: 50
Gender: Male
Posts: 1,728
Location: 47°36'N 122°20'W

28 Oct 2011, 11:12 am

Quote:
<a href="http://www.somedomain.com" target="_blank">Some Domain</a>


There are other "targets". Try this:

http://www.w3schools.com/

Everything you ever wanted to know about web design is referenced on that site.



TallyMan
Veteran
Veteran

User avatar

Joined: 30 Mar 2008
Gender: Male
Posts: 40,061

28 Oct 2011, 11:27 am

Dilbert wrote:
Quote:
<a href="http://www.somedomain.com" target="_blank">Some Domain</a>


There are other "targets". Try this:

http://www.w3schools.com/

Everything you ever wanted to know about web design is referenced on that site.


Perfect! Thank you DC and Dilbert; exactly what I wanted. :thumleft:

I've got a few links on my own website referencing other websites but think it better if those links open in a new tab/window rather than navigate away from my site. I've just tried the above and it works exactly as wanted.


_________________
I've left WP indefinitely.


Obres
Veteran
Veteran

User avatar

Joined: 13 Jul 2007
Age: 43
Gender: Male
Posts: 1,423
Location: NYC

29 Oct 2011, 8:43 pm

I prefer quackit over w3schools. It's more thorough imo.