Search code examples
xhtmlw3c-validationwcagxhtml-1.1

Why is target="_blank" not advisable to use with XHTML?


It's valid in XHTML 1.1 and WCAG 2.0 guidelines don't have any info about its usage?

I know it's not valid in XHTML 1.0 strict, but if many people are using other things like JavaScript, jQuery, rel attribute, PHP etc.

Does it make sense? It means people don't want to follow validation rules, they just want to skip the validation.


Solution

  • It's mainly to do with separating content from behaviour. The basic premise is that we should use HTML/XHTML to denote content, CSS for presentation and layout, and JavaScript for interactivity.

    The target attribute doesn't fit in with this paradigm (it's a bit of HTML content that affects browser behaviour), which is why its use is frowned upon.