Answers for "option select multiple values"

7

how to choose multiple option from select option

<!-- JUST ADD multiple ATTRIBUTE WITHIN select ATTRIBUTE -->
Cars:<br>
<select name="car" multiple>
    <option value="Volvo">Volvo</option>
    <option value="Thar">Thar</option>
    <option value="Audi">Audi</option>
</select>
Posted by: Guest on August-23-2020
0

getting te value of select multiple value

var options = document.getElementById('select-meal-type').selectedOptions;
var values = Array.from(options).map(({ value }) => value);
console.log(values);
Posted by: Guest on April-07-2022

Code answers related to "option select multiple values"

Browse Popular Code Answers by Language