The style
element does not support the attribute disabled
. According to the HTML specification:
<!ELEMENT STYLE - - %StyleSheet -- style info -->
<!ATTLIST STYLE
%i18n; -- lang, dir, for use with title --
type %ContentType; #REQUIRED -- content type of style language --
media %MediaDesc; #IMPLIED -- designed for use with these media --
title %Text; #IMPLIED -- advisory title --
>
However, in the HTMLStyleElement
DOM interface, there is a property called disabled
. As stated in the DOM specification:
interface HTMLStyleElement : HTMLElement {
attribute boolean disabled;
attribute DOMString media;
attribute DOMString type;
};
It's important to differentiate between an HTML element and its representation in the DOM. The fact that something can be done dynamically but not statically is not unusual. The HTML and DOM specifications serve different purposes. HTML functions as a markup language, while the DOM provides a standard way to work with document objects.