The check box is bound with a click event. click Select once, click unselect, and so on. This function is okay in ie, but it is okay in the previous two tests in firefox. It can be properly displayed and canceled, but when it is selected again, the check box attribute checkbox value change check box is bound to the click event. click Select once, then click unselect, and so on. This function is okay in ie, but it is okay in the previous two tests in firefox. It can be properly displayed and canceled, but when it is selected again, the checkbox value of the attribute of the check box is changed to "checked". No problem, but the check box does not display the selected status. It is strange that the attribute value is changed but not checked. The code is modified but cannot be correctly displayed. After a long time, you cannot find the cause. Positive Solution: It turns out to be a jQuery version problem. $ ("**"). Attr ("attrName") is used for the Operation attribute, while jQuery uses 1.9. This is a compatibility and stability issue. JQuery API clearly states that 1.6 + jQuery uses prop, especially the checked attribute judgment of checkBox, that is, $ ("input [type = 'checkbox']"). prop ("checked"); $ ("input [type = 'checkbox']"). prop ("disabled", false); $ ("input [type = 'checkbox']"). prop ("checked", true); in use, you can change attr to prop to solve the problem.
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