13 Ocak 2023 Cuma

Get selected values in a multi-select drop-down with JavaScript

 var hexvalues = [];

var labelvalues = [];

$('#myMultiSelect :selected').each(function(i, selectedElement) {
 hexvalues[i] = $(selectedElement).val();
 labelvalues[i] = $(selectedElement).text();
});

Hiç yorum yok: