The solution to the problem of the reaction delay of the checkbox under IE double click _javascript skill

Source: Internet
Author: User
Copy Code code as follows:

<span style= "FONT-SIZE:18PX;" ><input type= ' checkbox '/></span>

The above code in IE will generate a multiple-selection box, click it will check tick, click again will cancel tick.

There's nothing wrong with that, but if you try to do it two times faster, click a little slower than double-clicking. This button may not be as effective as you think.

Under IE, if the checkbox is selected at this time, the first click in the process of a quick two click will cause the checkbox to be unchecked, and the checkbox will not become selected after the second click, but continue to remain unchecked.

In browsers such as Chrome, the first click causes the checkbox to be unchecked, and the checkbox reverts to the selected state after the second click.

So in IE, after double-clicking, the checkbox will become the opposite state. In non IE, double click the checkbox to the same state.

If you want to double-click the checkbox under IE to achieve the effect of non ie, you need to use the following code:
Copy Code code as follows:

<input type= ' checkbox '/>
$ ("input[type= ' checkbox ']"). attr (' ondblclick ', ' This.click () ');

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.