1$("#country").change(function() {
2 var newVal = $(this).val();
3 if (!confirm("Are you sure you wish to destroy these country branches?")) {
4 $(this).val($.data(this, 'val')); //set back
5 return; //abort!
6 }
7 //destroy branches
8 $.data(this, 'val', newVal); //store new value for next time
9});
10