Re: ID Attribute

The W3C Validator is SGML based, this means that actually reads the
associated DTD from the Doctype declaration. If you want to be
conforming and use "id" on <script>, you need to change the doctype.
You can use:
- XHTML1.0 Transitional
- XHTML1.1
- HTML5

They're both backward compatible with current HTML4 transitional
content (at different levels), but I personally recommend the last, as
it does not costraints you to be XML-compatible.
The doctype for HTML5 is "<!DOCTYPE html>" (very simple)

Giovanni

2009/3/13 Chris Ward <hostmaster@wirefire.com>:
> Not for HTML validation, it is for XHTML validation
>
>
> http://validator.w3.org/check
>
> Error  Line 377, Column 11: there is no attribute "ID".
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <script id="script_page_content" type="text/javascript">
>
>
> -----Original Message-----
> From: Ian Hickson [mailto:ian@hixie.ch]
> Sent: Thursday, March 12, 2009 11:29 PM
> To: Chris Ward
> Cc: public-html-comments@w3.org
> Subject: Re: ID Attribute
>
> On Thu, 12 Mar 2009, Chris Ward wrote:
>>
>> Will, or can, we see a change with the "ID" attribute.
>>
>> IMHO the "ID" attribute should be able to identify any element within an
>> HTML document/DOM.
>>
>> However, there is 1 element and possibly others that do not use the "ID"
>> element such as:
>>
>> <script>
>>
>> I, myself, find it disturbing that I cannot give some sort of attribute
>> to a <script> tag to make it distinguishable for removal that is W3c
>> compliant, maybe I'm missing something very simple, I don't know.
>
> id="" is valid on <script>.
>
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>
>
>
>

Received on Friday, 13 March 2009 16:02:56 UTC