JQuery: change event not firing in IE

I have code updating a dropdown, and then I fire the "change" event manually. It works as it should in firefox, opera, etc., but not in Internet Explorer. Any idea why?

The code below.

$(".bringFraktvalgRadio").click(function() {
    var selectedValue = $(".bringFraktvalgRadio:checked").val();
    $("#<%= dropDeliveryOption.ClientID %> option[value=" + selectedValue + "]").attr("selected", true);
    $("#<%= dropDeliveryOption.ClientID %>").trigger("change");
});
+3
source share
2 answers

Look at my question for something like this with a checkmark. Check the answer I gave has a link and don't forget to use blur and focus.

0
source

Sorry, but the change event does NOT work as it should in IE (mainly IE6).

1: , , "click" , "click".

2: - . jQ :

$("#yourSelect").bind('myChange',function(){
 //do the chacha
})

:

$("#yourSelect").trigger("myChange");
0

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


All Articles