HTML CODE
<select class="form-control" name="min_select[]">
<option value="15">15</option>
<option value="30">30</option>
</select>
JQuery Code
var val1[];
$('select[name="min_select[]"] option:selected').each(function() {
val1.push($(this).val());
});
when i run this code I get empty val array
This will also work
var val1= $("select[name=\'min_select[]\']").map(function() {
return $(this).val();
}).toArray();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With