This year, even the msdn library is unreliable.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.