Why ‘target’ is deprecated in XHTML
I was running a W3 validation on my page to see if I had any non-compliant code. My DOCTYPE right now is transitional, however, the W3 validator allows you to test different DOCTYPE’s regardless of your actual DOCTYPE.
My goal is to, of course, validate the page XHTML Strict. So I tried validating this site using DOCTYPE strict and it came back with 1 error.
Apparently, the ‘target’ attribute on ‘a’ tags is deprecated. I thought it was a little odd. How the heck am I supposed to open up another window? Using Javascript seemed way too involved when I could just add that attribute to my ‘a’ tags.
So I did some digging around to find out why this was. I came across a great website called 24ways.org. They feature interesting articles on web design standards. They published an article discussing transitional vs. strict markup. I did a page search to find any references to ‘target’ and came across an explanation for the ‘target’ deprecation in a comment from Drew McLellan. He said,
target="_blank"is deprecated because it suggests a behaviour. The ideal is that XHTML deals with the content, CSS with the presentation, and JavaScript with the behaviour.target="_blank"violates this, and is therefore deprecated.
This makes total sense. It just sucks.
No Comments