I have 3 selects
, I want that when one is chosen, it is deleted from the other 2 but without deleting the first one. Is it possible?
<select class="sel">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
<select class="sel">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
<select class="sel">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
</select>
<script>
$(document).on('change','.sel',function(){
var opcion = $(this).val();
$('.sel').each(function(){
$('.sel option[value="'+opcion+'"]').remove();
})
});
</script>
It is eliminating the value of the SELECT from where I took it. How can I prevent that?