现在的位置: 首页 > 综合 > 正文

IE下checkbox无法立即响应onchange的解决方法

2013年09月07日 ⁄ 综合 ⁄ 共 310字 ⁄ 字号 评论关闭

If you click on a radio button, IE seems to wait with firing the change event until you leave the button,

which is consistent with the behavior on other input fields (like text), but kinda unintuitive.The following piece of code fixes this behavior for me:

$(function () {
    if ($.browser.msie) {
        $('input:radio').click(function () {
            this.blur();
            this.focus();
        });
    }
});

抱歉!评论已关闭.