<div class="situacaoPedido col-md-12"> <select id="StatusPedidoSaveId" name="StatusPedidoSaveId" class="select2"> <option value="" selected>Selecione</option> <option value="1">Pendente Compra</option> <option value="2">Aguardando Pagamento</option> <option value="3">Confirmado</option> <option value="4">Aprovado</option> <option value="5">Em Separação</option> <option value="6">Enviado</option> </select>
$("#modal-trocar-status").on("show.bs.modal", function () { $("#DataPedido").val(''); $("#numPedido").val(''); $("#observacao").val(''); //$('#StatusPedidoSaveId').prop('selectedIndex', 0); //document.getElementById('StatusPedidoSaveId').selectedIndex = 0; $("#StatusPedidoSaveId").val($("#StatusPedidoSaveId").data("default-value")); $('.obsAlteracao').hide(); $('.dadosAlterados').hide(); });
change
$("#StatusPedidoSaveId").val('').trigger('change');
defaultSelected
$('#my_select option').each(function () { if (this.defaultSelected) { this.selected = true; return false; } })
<option value="b" selected="selected">b</option>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)