This article mainly introduces how to solve the latency problem by double-clicking checkbox under IE. For more information, see
The Code is as follows:
The above code will generate a multi-choice box under IE. Clicking it will check the box and clicking it again will cancel the check.
It seems nothing wrong, but if you try to click twice quickly (a little slower than double-click ..) This button may not work as you think.
In IE, if the checkbox is selected at this time, when you click twice quickly, the first click will make the checkbox unselected, after the second click, the checkbox will not change to selected, but will continue to be deselected.
In Chrome and other browsers, the first click will cancel the checkbox selection. After the second click, the checkbox will be restored to the selected status.
So in IE, after double-clicking, the checkbox will change to the opposite state. In a non-IE environment, the checkbox is in the same status after double-clicking.
If you want to double-click checkbox under IE to achieve the effect of non-IE, you need to use the following code:
The Code is as follows:
$ ("Input [type = 'checkbox']"). attr ('ondblclick', 'this. click ()');