Launch and Open Links in New Window or Tab with _blank or _new as Target in HTML and Their Difference

On most websites, publishers may prefer to open the links to other web pages, especially external links that open web pages out of their own sites, in a new web browser window or tab, as most of the time, clicking on a link will load the new document from the link in the same window with where the link was. In HTML web programming language, to launch the new document (web pages) from links in a new window or tab effect is typically done through the use of target attributes on those links.

In this case, the link anchors will be using “_blank” as the value of the “target” attribute. “_blank” tells the web browser to open the new document loaded from the link in a new window. “target” attribute is also used in websites with frame structure to tell the web browser which frame the target page of a link should open when click. However, “_blank” does not require the use of any frames. The syntax or HTML code is typically as below:

<a href=”newwindow.html” target=”_blank”>New Window</A>

There are also publishers who use “_new” instead of “_blank” as the value for “target” attribute to open a link in new window. There is actually no “_new” defined as frame target names by W3C HTML standards. The only four reserved names are “_blank”, “_parent”, “_self” and “_top”. However, the “_new” value works the same way as “_blank” to launch the linked web documents in new browser window because of graceful error handling by web browsers. So “_new” is not a valid value for “target” attribute in link <a> anchor, and may cause inconsistent behaviour for strictly HTML compliant browser that ignores all other target names as frame target name should begin with an alphabetic character (a-z and A-Z).

When “_new” is used, the web browser will look for an existing browser window that carries the “_new” handle name. If there is none then browser will create and launch the target web document at new window (or new tab in browser that supports tabbed browsing), where browser is considered to be recovering from HTML error of targeting a non-existent window. In this case, the new window will be named “_new”. However, if a window or a tab with “_new” handle already existed, the target page will be loaded into that window instead. Theoretically, you no need to use “_new” as the value for “target”, as any other value name (i.e. “newwindow” or “newtab”) will work to create a new window if the so named window hasn’t existed yet when clicked on the link.

In other word, if you want the links to open in a new window on every click, use the “_blank”. And you can use “_new” or another other valid value name starting with alphabetic character to open a new window and re-use that window for any other subsequent clicks that target to the same name.


12 Responses to “Launch and Open Links in New Window or Tab with _blank or _new as Target in HTML and Their Difference”

  1. Sven
    November 10th, 2009 01:54
    12

    Thanks this was great! Found an other solution

    http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread/8aedc1bc-f588-4bb8-a4a9-0674ad1d1101

  2. V.C
    October 28th, 2009 17:07
    11

    I always forget this code although I did it more than hundreds times. Thanks!

  3. Pascal
    October 18th, 2009 18:38
    10

    Thank you,great information!

  4. Ximena
    October 12th, 2009 03:11
    9

    Many thanks!!!

  5. amrit
    September 4th, 2009 21:38
    8

    really good post

    thanks

  6. jmc
    July 3rd, 2009 20:43
    7

    Thenk you!

  7. Manoj
    June 24th, 2009 20:36
    6

    very informative. Thank you.

  8. Alev
    January 13th, 2009 19:31
    5

    Great post thank you.
    I want to ask a question. How can i open a page in a new tab in IE7? What can i use instead of window.open in javascript?
    Have you got any idea for this?

  9. DanS
    November 7th, 2008 19:55
    4

    Very helpful. Wondering if there’s a way to provide some sort of command to make the URL open in a tab only.

    Any thoughts or knowledge is most appreciated!

  10. yesa
    April 10th, 2008 13:42
    3

    Your blog is so helpful. Thank you.

  11. Brian
    December 24th, 2007 12:41
    2

    Great Post! Important piece of information.

  12. Gustavo Ricou
    July 9th, 2007 23:27
    1

    thank you…

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

html open link in new tab - link:toolbar:new_tab.html - open link in new tab html - toolbar:new_tab.html - HTML link open in new tab - related:toolbar:new_tab.html - html link new tab - html new tab - open link in new tab - a href new tab - href new tab - html open in new tab - new tab html - html link in new tab - html link open new tab - html code open link in new tab - target _blank new tab - html code to open link in new tab - html code open in new tab - html to open link in new tab - html open new tab - html target new tab - open link in new tab html code - link new tab - href target new tab - html code for opening link in new tab - window.open new tab - link target new tab - _blank new tab - open link new tab html - open in new tab HTML code - html open link in a new tab - html code for opening new tab - open a link in a new tab html - href open in new tab - opening link in new tab html - window.open tab - href in new tab - html open in new tab target - html for new tab - link html new tab - html open link new tab - toolbar:new_tab.html - html code to open in new tab - html to make link open in new tab - make link open new tab - html anchor open in new tab - a href open in new tab - a href target new tab - a href open new tab -