Because when you change the value in the drop-down list, it changes the structure of the drom child. this means that you are changing the value of A a B, this is patent A and B is X, so it automatically changes, so you need to stop the distribution of events.
you need to remove below code
$(a) .change (function () {$(x) .trigger ('change');}); $(b) .change (function () {$(x) .trigger ('change');});
or you need to use preventDefault ();
$(a) .change (function (e) {e.preventDefault(); $(x) .trigger ('change'); return false; }); $(b) .change (function (e) {e.preventDefault(); $(x) .trigger ('change'); return false; });
source share