If you have multiple select boxes with multiple='multiple' and you want to select all selected options from every dropdown then use this HTML:
<select id='Alphabets'>
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
</select>
<select id='Alphabets' multiple='multiple'>
<option value="4">D</option>
<option value="5">E</option>
<option value="6">F</option>
</select>
<select id='Alphabets'>
<option value="7">G</option>
<option value="8">H</option>
<option value="9">I</option>
</select>
<select id='Alphabets' multiple='multiple'>
<option value="10">J</option>
<option value="11">K</option>
<option value="12">L</option>
</select>
JavaScript for above UI:
function show_Alphebets()
{
var tag =document.querySelectorAll("select");
var values="";
for(var i=1; i<4; i++) {
if(tag[i].options.length>0)
for (var option of tag[i].selectedOptions) {
values+= i+"(multiple)="+option.value+",";
}
else values+= i+"="+tag[i].value+",";
}
alert(values);
}