If you use a dojo framework to render a GUI widget, the value of this HMTL markup may affect the rendering of your components (and is different for older IE browsers). Dojo draws attention to the value of the DOM object representing the disabled attribute. For example, this markup will display an enabled widget enabling Chrome or> = IE9:
disabled="false"
This is the opposite of how vanilla HTML components behave, which will be disabled solely because the attribute is disabled (as is the case with the Zed post).
In Chrome and IE9 / later, the value of the disabled attribute is accurately stored in the DOM object that represents it (for example, if the attribute is not in the markup, this attribute is not even defined on the DOM object). Since the DOM object is that Dojo drives when it displays its widgets, the value in the HTML markup will have an effect.
In IE8 / earlier, the attribute value is stored in the DOM differently. Firstly, the disabled attribute is always present, and secondly, only its absence ensures that the value is false (in this case, the Dojo widget will be displayed turned on).
Note. Modern IE browsers can be used to change their behavior in older versions (for example, the X-UA-Compatible meta tag using content="IE=8" ).
Example 1 valid html markup
As with Zed, only one of them should be enabled (in any browser):
<button>OK</button> <button disabled>OK</button> <button disabled="false">OK</button> <button disabled="true">OK</button> <button disabled="mickey">OK</button> <button disabled="">OK</button>
Example 2 Dojo html markup
The first and third of them are activated using Dojo (in Chrome / IE9 or later):
<button dojoType="dijit.form.Button">OK</button> <button dojoType="dijit.form.Button" disabled>OK</button> <button dojoType="dijit.form.Button" disabled="false">OK</button> <button dojoType="dijit.form.Button" disabled="true">OK</button> <button dojoType="dijit.form.Button" disabled="mickey">OK</button> <button dojoType="dijit.form.Button" disabled="">OK</button>
In IE8 or lower, it will display exactly the same as in the first example.
Strange "" evaluates to false in JavaScript, but does not translate it into a false value in the context of the above examples (and therefore the widget included).