“Selecione Opções do Select2 Control com base em valores usando jQuery” Respostas de código

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

Respostas semelhantes a “Selecione Opções do Select2 Control com base em valores usando jQuery”

Perguntas semelhantes a “Selecione Opções do Select2 Control com base em valores usando jQuery”

Mais respostas relacionadas para “Selecione Opções do Select2 Control com base em valores usando jQuery” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código