📅  最后修改于: 2022-03-11 15:01:07.043000             🧑  作者: Mango
$("#country").change(function() {
var newVal = $(this).val();
if (!confirm("Are you sure you wish to destroy these country branches?")) {
$(this).val($.data(this, 'val')); //set back
return; //abort!
}
//destroy branches
$.data(this, 'val', newVal); //store new value for next time
});