Я не могу сбросить выбор;Javascript

Форум по Javascript
Anonymous
Я не могу сбросить выбор;

Сообщение Anonymous »

Я сталкиваюсь с проблемой, используя выбор. JS . Я делаю приложение со страницами Razor , и я не могу сбросить Select Selection
Я просто хочу удалить выбор Select , Возврат его в свое начальное состояние < /p>

Код: Выделить всё

$('#destino').change(function() {
var origem = "2" //$('#origem').val();
var destino = $(this).val();
if (origem && destino && origem === destino) {
console.log(origem,destino)
/*
Toast.fire({
icon: "warning",
title: "Os pontos de origem e destino devem ser diferentes."
});
*/
$('#destino').val("");
}
});< /code>





Destino

Selecione uma opção
Parceiro 1
Parceiro 2
Parceiro 3
Parceiro 4
Parceiro 5




Подробнее здесь: https://stackoverflow.com/questions/794 ... the-select

Вернуться в «Javascript»