Search code examples
htmlhreftarget

why does this code <a target="Open in New Window"> opens in a new window?


I forgot to replace the words "Open in a New Window" with _blank when testing a system and I found that even though the html looks as such, it still opens in a new tab.

<a target="Open in New Window" href="http://google.com">Google</a>

here is a jsfiddle to see for yourself!

note: I'm using latest Firefox on OSX. I also tested in Chrome in which case it also works.

Why does this happen?


Solution

  • http://www.w3schools.com/tags/att_a_target.asp

    Because if it's not a known parameter it takes it as a window name and create a new window as none of that name are available.