Occasionally web developers like their links to pop-up in a new window. Often times this is because they are linking to a non-web file type or are linking to an external web site.

The easiest way to accomplish this is to place the target="_blank" attribute on an anchor. Unfortunately if you validate your code with the W3C you will find that it is not valid to use that practice. Do not fear, there is a solution!

The workaround err, solution, is to place an onclick on the anchor tag. The code below will open a new window, get the value in the href attribute and cancel the action the href attribute would take.

<a href="http://www.nealgrosskopf.com" onclick="window.open(this.href);return false;">Link</a>