/    Sign up×
Community /Pin to ProfileBookmark

html validation for target="_blank"

hi guys ?

when validating html for <a href=”http://www.abc.com” target=”_blank”>abc</a> this gives an error, on the target attribute.

Can this be solved using CSS?

Thx in advance.

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@MstrBobDec 28.2005 — Nope. So I'm moving this to html. It can, however, be solved using Javascript.

[code=html]
<a href="http://www.abc.com" onclick="window.open(this.href);return false;" onkeypress="window.open(this.href);return false;">abc</a>
[/code]
Copy linkTweet thisAlerts:
@Bobby_SauthorDec 28.2005 — hmm, it's for reciprocal links on a link exchange page.

People don't like Javascript links. So I'll not go for that option.

Thanks anyway!
Copy linkTweet thisAlerts:
@JPnycDec 28.2005 — Just use the target attribute. It was stupid to deprecate it in the 1st place.
Copy linkTweet thisAlerts:
@MstrBobDec 28.2005 — 1) It is not a javascript link. The link, in fact, is a standard link. However, if javascript is enabled, it will be triggered to open in a new window, just like the target attribute. The link, in fact, still works with Javascript disabled, and can still be picked up by search engines.

2)Target attribute was intended for frames, so use outside of it was considered abuse. In fact, it's still available in the Transitional DTD's, which is the DTD that's required when using HTML frames.
Copy linkTweet thisAlerts:
@NogDogDec 28.2005 — It should validate if you use the "loose" DTD.
Copy linkTweet thisAlerts:
@felgallDec 28.2005 — The idea is supposed to be that your visitors should be able to choose whether to open links in a new window. Not specifying a target gives them the choice by right clicking on the link and selecting where to open it. Specifying a target forces them to go back and close the window with your site in it after they decide to leave by clicking on the link.
×

Success!

Help @Bobby_S spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...