我想检查是否有任何其他与当前选择匹配的选定值。所以当.payment-method
变化我得到的价值,并检查其他.payment-method
s的值。我想排除触发更改的下拉菜单。 .not(this)
不起作用。从触发事件的所有下拉菜单中获取选定值
$(document).on('change', '.payment-method', function() {
var thisVal = $(this).val();
console.log("this value" + thisVal);
$(".payment-method option:selected").not(this).each(function() {
console.log($(this).val());
});
});