With the advent of XHTML Strict 1, you can no longer use target=”_blank” on an A tag in your code. The only solution for this is to use Javascript to action a new window / tab to be opened.

The traditional way would be something this:

This was written by Mike van Rooyen at 9xb.

A much simpler way of doing this comes with jQuery, and can be reduced down to one line.

Mike’s solution also makes sure that it doesn’t apply this to links to your own site, which is useful for sites running frameworks like WordPress – where links are embedded absolutely.

Therefore, something like this might be a little more suited.

Image Credit: paloetic