Every relevant “question that may already have [my] answer” uses jQuery, which I am not using.
So, is there any simple way to get the values of selected options in a <select multiple> tag, or do I have to loop through all the options to see which ones are selected and manually build an array?
Side-question: Which browsers don’t support selectElement.value and instead require selectElement.options[selectElement.selectedIndex].value?
You can use
select.selectedOptions. However, this returns anHTMLCollection, so you still have to clean it to get a string array. http://jsfiddle.net/9gd9v/and: