In the work using jquery operation checkbox, select all, reverse the election, now the problem is the second time Firefox can not check the problem, there is a detailed answer below, interested friends can refer to the
Recently, using the jquery operation checkbox in your work, use the following method to select all, to reverse the selection: Copy code: var ischecked=allcheckobj.is (': checked '); Ischecked?checksobj.attr (' checked ', true): checksobj.attr (' checked ', false); Debugging in IE no problem, considering compatibility, try Firefox, encountered a problem. As a result, the following experiments were done: the check box binds the Click event, the click is checked, and then the uncheck, and so on. This function in IE no problem, but in Firefox test, the first two times are no problem, you can display the check and cancel, but when you go to select, check box property checkbox value to "checked", no problem, but check box does not show the selected state, Obviously the attribute value changed, but did not show tick, too strange. Code modification but not get the right display status, tangled up for a long time, can not find the reason. Positive solution: Later by the idol direction, the original jquery version of the problem. I manipulate attributes with $ ("* *"). attr ("Attrname"); the jquery version uses 1.9, which is a compatibility and stability issue. The jquery API clearly shows that 1.6+ jquery uses the prop, especially the checked properties of the checkbox, to copy the code as follows: $ ("input[type= ' checkbox ')". Prop ("Checked" ); $ ("input[type= ' checkbox ']"). Prop ("disabled", false); $ ("input[type= ' checkbox ']"). Prop ("checked", true); In use is to change the attr to prop, the problem is solved. Have you met this strange question? Just try it.