cancel drop down list onchange event javascript code example
Example: cancel drop down list onchange event javascript
$("#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
});