RE: target is invalid attribute for a

Gentlemen, you are both absolutely correct, of course.

My use of “always vaid” was a bit flippent.  Certainly I wasn’t thinking earlier than version 4 of HTML.  I’m surprised that it is not valid in 4.x strict, since nothing I have read ever said that (the average user does not read specs).  But I accept that.

Yes, I expect a validator to conform to formal specs.  No question there.

The problem stems from the W3C validator<https://validator.w3.org/#validate_by_input+with_options> itself.  It does not let me choose the correct doctype for code snippets:

[cid:image001.png@01D394DF.6BFDF660]

I’m using html5.  I will live with the problem.

Thanks for taking the time to respond, and doing so quickly and thoroughly.  Much appreciated.

- Ed



ED BRANDON
Volunteer               Volontaire
CANADIAN PUBLIC HEALTH ASSOCIATION              ASSOCIATION CANADIENNE DE SANTÉ PUBLIQUE
404-1525 Carling Ave.
Ottawa ON K1Z 8R9
<http://www.cpha.ca>            T: 613-725-3769 x 165
F: 613-725-9826

From: David Dorward [mailto:david@dorward.me.uk]
Sent: January-23-18 11:47 AM
To: Ed Brandon
Cc: Philip Taylor; www-validator@w3.org
Subject: Re: target is invalid attribute for a


On 23 Jan 2018, at 16:40, Ed Brandon wrote:

From what I can tell, the target="_blank" is always valid. It need not be specific to either HTML 4 or 5, nor to the variants strict, transitional or frameset. It’s been around a while, and never changed.

It is not.

It is valid in HTML 5.x, HTML 4.x Transitional, and HTML 4.x Frameset.

It is not valid in HTML 4.x Strict, HTML 3.2, or earlier versions of HTML.

I tend to test snippets – equivalent to the contents of a page – because I’m using the Drupal CMS that was set up by a third party. It generates lots of correctly-identified errors. I live with that simply because I know it won’t be fixed. But I like to ensure that my contributions are OK.

So I add snippets directly. The default options show as:

… detecting the Doctype automatically.

So what snippet are you putting in there? What Doctype does it have? What does the validator report it is checking the document as? (E.g. “Errors found while checking this document as HTML 4.01 Transitional!”).

I leave this alone. I do believe it should not give me an error message.

It is highly unlikely that you’ve found a bug here. You don’t appear to be triggering the new HTML 5 parser, and the target attribute is common enough that I’d expect any false positives to have been noticed before.

Received on Wednesday, 24 January 2018 11:59:40 UTC