开发者

Jquery dropdown select issue in Chrome and IE

The following code works in Firefox but not in Chrome and IE. Any idea why? Thanks!

$('#image_dd option:selected'开发者_如何学Go).live('click', function() {

    alert("TEST 1");

    if ($("#image_dd").val().length) {
          alert("TEST 2");
    }

    return false;

});


IE doesn't pick up "click" for select options (although firefox does!). You will probably need to use the "change" event instead, works fine in ie, chrome and firefox.


I think your trying to bind to the wrong element and event. Try binding your event handler to the select element and using the "change" or "blur" triggers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜