Jquery change event not firing in Internet Explorer (IE)

Well, I know that there are other questions related to mine, but not one of them that I read answered my question.

I have a select tag with some parameters attached to the change event, but when the user presses the select button and then presses up / down, the change event does not fire in IE. It runs in Firefox and I have not tested Chrome.

So, I think, I would like to know if there is an easy solution for this, I would just like to make

$("#selector").change(function () {//Add code });

The workaround for me right now is this:

$("#selector").bind('change keyup',function () {//Add code });

I think I could create a plugin like this:

$.fn.myChange = function (fcn) { return this.bind('change keyup',fcn);}

, jquery (), , , .

, . ?

UPDATE

bug jquery, , .

, . , , /. , IE , FF Chrome .

+3
3

, , :

$("#sel").bind($.browser.msie ? 'propertychange' : 'change', function(e) {
    $("#output").append("boxval changed!" + $(this).val());
});

, + $(this).val(), , .

: http://jsfiddle.net/At8Ht/3/

, : ( ), .

$("#sel").bind('propertychange change', function(e) {
    $("#output").append("boxval changed!" + $(this).val());
});
+5

IE onchange , . , .

, , IE . javascript, onchange, onclick-, . , jQuery. 99% , . 1%, , .

+3

It should work on all browsers. I have had your problem also several times, and in most cases this is because I did not add an event handler to readiness (jQuery.ready).

-3
source

Source: https://habr.com/ru/post/1788348/


All Articles