Even if I remove the link in question, another random link returns with the same validation error relating to the "_target" tag. Does anyone have a fix for this? I'm getting this error when I attempt to validate my wordpress: 1. Error Line 133, Column 84: Attribute "target" exists, but can not be used for this element. …m/" title="Aviation Chatter" target="_blank">Aviation Chatter</a></li> ✉ You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash. Code (markup):
You're probably validating strict XHTML 1.1 or 1.0. This is deprecated for XHTML 1.1, you'll either need to change to XHTML 1.0 transitional in your DOCTYPE, use javascript, or there might be some other work around but I don't know what it is off the top of my head.
Besides being a generally bad idea, forcing a new window when opening a link is just bad manners. You're messing with the user's expectations of how his browser will work. That said, some clients just can't be talked out of doing the wrong thing. The target attribute is deprecated, and not a part of the current specs for (x)html. You can do it with a simple bit of javascript. window.onload = function() { var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { var rels = links[i].getAttribute("rel"); if (rels) { var testpattern = new RegExp("external"); if (testpattern.test(rels)) { links[i].onclick = function() { return !window.open(this.href); } } } } } Code (markup): To each link you want to open a new window, add "rel='external'", like so: <a href="some.html" rel="external">somewhere else</a> Code (markup): cheers, gary