You are here: Computer Video TutorialWordpress TutorialThere is no attribute “target” HTML strict Fix
Due to regular updates on WP, if you look for Twenty Eleven theme modification or customization tutorial, first of all, first check this post. Thanks.

There is no attribute “target” HTML strict Fix

by Kimi on December 4, 2010

There is no attribute “target” w3c error experience.

I have a habit with my blogs, about once or twice a month, i checked the validation in w3c. With this blog, i have checked almost once a week or sometimes more often, depends on how often i modify some stuff.

My another experience with validating wordpress code is with Thesis theme.

I choose Thesis is the best SEO theme for wordpress, one of the reason is it has clean code, therefore it is validated in W3C validator. (see more about how to validate wordpress in w3c post)

The great thing with Thesis is also it has XTML strict, which is good, but harder to learn.

Thing was i wanted to put “target:_blank” on my link, and i checked the validator, the result is there is no attribute “target” error message.

There is no attribute “target” XHTML Strict and Transitional.

This blog uses XHTML Transitional, therefore i can use the code: target=”_blank”. But Thesis theme is using XHTML strict, this is why we can’t use target=”_blank” otherwise it will end to there is no attribute “target” in w3c validator website.

I choose to learn XHTML transitional since it is not so difficult and has less rules than the strick ones. Transitional is easier to learn for beginners, like myself.

The benefit of having XHTML strick is it makes visitors browsers to renders our sites more strict, means it improves accessability of your site, by visitors, and search engines bots.

There is no attribute “target” w3c error fix.

If you use Thesis or other XHTML strict document, there are some attributes that you can’t use, but allowed in transitional.

For example, in my case, i wanted to validate the target=”_blank” but got there is no attribute “target” error notification.

The error screenshot:
there is no attribute target

How to fix? it is actually not complicated, after doing researches in some forums, i found this code is validated to replace:

onclick="target='_blank';"

blog seo

So example: you want to type: <a href=”#” target=”_blank”> in XHTML strict, you will have to modify that code to:

<a href=”#” onclick=”target=’_blank’”>

It can be tricky sometimes, see more on one of my post validating javascript in wordpress.

That’s how i fix my there is no attribute “target” error notification invalid message in w3c.

Subscribe new tips via Email:

Was the post helpful? Share it to help others with:

{ 6 comments… read them below or add one }

ets February 26, 2011 at 4:08 am

Thanks! Very useful. I check my blog in w3c too xD

Reply

Kimi February 26, 2011 at 9:51 am

Hi ets,

Happy to hear! Thanks for leaving a comment :-)

Kimi.

Reply

BYA March 21, 2011 at 10:49 am

10x – it works

Reply

Rajesh Namase June 27, 2011 at 9:53 am

Any way to automatically change all tags into modified one, because I found same error. It is impossible to change all tags.

Reply

Suryakant December 26, 2011 at 3:29 am

Hi,
It great helps for me. Good job keep it up.

Thanks

Reply

Mike April 23, 2012 at 11:23 pm

This document was successfully checked as XHTML 1.0 Strict!

:>)

Thanks – Mike

Reply

Know better? Feedbacks, or Questions? Shoot! :-)

Please use a name instead of blog name or SEO stuff, otherwise it will be deleted right away.

About checkbox → See more my post:how to get rid of spam bots in wordpress post.

Thank you for visiting, you're always welcomed to be here again!

Previous post:

Next post: