Recently I found that some of my pages were not of valid XHTML Strict doctype and the culprit is the target attribute in my tag which I used to open external pages in new window.
Since this is my personal site I had the liberty to choose what ever I wanted and I have decided to leave it as it is. But my decision would have been different (or would have taken more time) if it was one of my client’s pages. So here after all my pages will have the XHTML Strict doctype and also the target attribute. After all rules are meant to be broken right 😉 what do you guys say?
Well, your site is much better than digg: It is atleast valid XML!
Better than Digg? Nice to hear that 🙂
Well, try to parse it out with Regex or Normal Parsing for two days, and then it’ll be even nicer:D
Though I did find a good library afterwards…
But, if it were atleast as compliant as your’s, I wouldn’t have even required that library:D
You can still implement the strict DocType and still use the target attribute.
If you use the standard HTML 4.01 strict doctype like so:
You can change it to:
This way you are still using the strict doctype, and the W3C validator will still pass your markup.
This will allow the target attribute to be used on “a”, “link”, “area” and “form”.
Just to note, that last recommendation by Jason is inaccurate. Only Transitional doctype allows the target attribute.