Jörn Zaefferer schrieb:
> Klaus Hartl schrieb:
>> Still you have to keep in mind that it is a boolean attribute and the 
>> DOM interface for enabling/disabling is to set a boolean value.
>>
>> And I furthermore encourage you to not rely on w3schools instead of the 
>> real W3C specs.
>>   
> Well, what would be then the right place to look for the DOM interface? 
> Can't find anything about a boolean attribute in w3 DOM Level 2 Core 
> spec nor in ECMA script spec.

Please have a look at the DOM Level 2 HTML Specification[1] (not Core):

In Section 1.6.1 "Property Attributes" there is stated, that a one-value
Value according to the DTD (e.g. disabled) has a Object Model Data type
of boolean[2].

Although it is also stated that such exposure of attributes as
properties is done for backwards compatibility and that it is deprecated 
in favor of the generic methods on the core Element interface for 
setting/getting/removing attributes, e.g. getAttribute etc., my checkbox
example shows that browsers do not have implented that correctly yet.
Thus the time to deprecate has not yet come.

Have a look at the Interface HTMLInputElement as well for example. The
disabled attribute is of type boolean, as well as the checked and the
readOnly attribute[3].

[1]http://www.w3.org/TR/DOM-Level-2-HTML/
[2]http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-642250288
[3]http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025


-- Klaus




_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to