In MS-related development, the msdn library is simply a Bible, and it also makes sense to refer to msdn in many non-M $ development processes. Of course, we are unquestionable about the content described by msdn, but today we found that msdn has started to work.
For "disabled attribute | disabled property", the remarks of msdn says:
When an element is disabled, it appears dimmed and does not respond to user input. Disabled elements do not respond to mouse events, nor will they respond to the contenteditable property.
If an element'sDisabledProperty is set to false but it is contained withinDisabledElement, it cannot overrideDisabledState of its container.
Well, the first paragraph is correct, and the second paragraph begins to talk about it. In fact, he didn't say that I had understood this before, because IE uses the bubble up method to handle events, and this effect is also in line with the bubble up design, this is because the child element event is too normal for ignore on the parent element from bubble up to disabled.
Let's take a look at the two examples below. Some of the event elements in the DIV can be ignore, and some can continue to bubble up, which is really messy.
the DIV element is disabled. |
|
the DIV element is disabled. checkbox radio button |
Both the Green Box and the blue box are DIV elements with Disabled = true, although the element UI is dimmed, however, only the buttons, input type = "checkbox", and input type = "radio" are cancel bubble up, and all of them can be normal event bubble up, even input type = "text" and input type = "password" can be edited.
It seems that msdn also has a time to live: (so pay attention when dealing with the disabled of the container. The most safe thing is that all children are disabled. Although it is troublesome, it is safe.