“Obtenha o valor selecionado do suspensão selecionado2 no jQuery” Respostas de código

Get Select2 Selected Value

//initialize
$('#mySelect2').select2('data');
//get selected value
$('#mySelect2').find(':selected');
Andrew Lautenbach

jQuery para definir valor no botão suspenso Select2

$("#u20_cre").select2().val(["1","6"]).trigger("change");
Calm Chinchilla

Selecione Opções do Select2 Control com base em valores usando jQuery

$('#mySelect2').val('1'); // Select the option with a value of '1'
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
Inexpensive Iguana

Selecione Opções do Select2 Control com base em valores usando jQuery

$('#mySelect2').val(['1', '2']);
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
Inexpensive Iguana

Obtenha o valor selecionado do suspensão selecionado2 no jQuery

$('#mySelect2').find(':selected');
Disgusted Dunlin

Respostas semelhantes a “Obtenha o valor selecionado do suspensão selecionado2 no jQuery”

Perguntas semelhantes a “Obtenha o valor selecionado do suspensão selecionado2 no jQuery”

Procure respostas de código populares por idioma

Procurar outros idiomas de código