Re: [VE][108] - "id" as Attribute in Title Tag

Yes, it is HTML 4.01.

I'm using the "id" of the <title> element in JavaScript code, and it works 
fine, although it's not officially accepted in HTML 4.01.




"Jukka K. Korpela" <jkorpela@cs.tut.fi> 
2010-09-04 15:49

To
<www-validator@w3.org>, <rolf@just-in-mind.se>
cc

Subject
Re: [VE][108] - "id" as Attribute in Title Tag




rolf@just-in-mind.se wrote:

> We get the error message - - -> there is no attribute "ID"
>
> for:
>
> <title id="title"> . . . . . </title>
>
> According to www.htmlref.com, "id" is a valid attribute.

It is in XHTML, but not in HTML 4.01, so apparently your document declares 

an HTML 4.01 doctype.

This is hardly a reason to move to XHTML, though. In which context would 
you 
possibly want to use an id attribute on the <title> element? The element 
is 
uniquely determinable anyway, since only one <title> element is allowed in 
a 
document.

The site you mention is not an authoritative reference, and it does not 
look 
like a handy practical reference either. For example, they say "The title 
should be the first element found in the head", even though HTML syntax 
does 
not impose such a restriction, and such placement can even be dangerous. 
(If 
you use a <meta> element to declare document encoding, then surely that 
tag 
should precede the <title> element if the latter contains any non-ASCII 
data.)

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Received on Monday, 6 September 2010 07:52:42 UTC