Wednesday, 30 September 2009

Anchor tag with target element

I'm trying to set up an anchor link so that it opens in a new page using the target element, but the HTML doesn't validate. The validation notes suggests using the XHTML Transitional document type instead of Strict.

Has anyone had any success with this?

Normal tag would look like this:
a href="http://www.google.com"

For the link to open in a new page, I think you should type this:
a href="http://www.google.com" target="_blank"


For more information, refer W3Schools.

No comments:

Post a Comment