There are many question already existing similar to this topic however I can't find any that address this specific problem.
If I have a <select>
element where multiple selections are allowed, how can I iterate ONLY through ones that the user has SELECTED.
jQuery and/or Vanilla accepted.
select{
overflow:auto;
width: 150px;
}
<select id="the_select" size="5" multiple>
<option>Bob</option>
<option>John</option>
<option>Sam</option>
<option>Jason</option>
<option>Sarah</option>
</select>
Similar Posts that don't help:
Iterate through <select> options - For all options, not just selected ones
How to check if an item is selected from an HTML drop down list? - Doesn't work for multiple
selections