how to make a javascript function that prevent any option to be selected twice to html select option code example
Example: javascript prevent value change in select option
old_value = $('#select :selected').val();
$('#select').change(function() {
if($(this).val() == 'option 3') {//your specific condition
$('#select').val(old_value);
} else {
old_value = $('#select :selected').val();
}
});