I'm surprised I can't find this code online!
How do I access ALL the selected indices of a select list? Not just the first one?
HTML:
<select name="trends[]" multiple="multiple" id="trends" size="35"></select>
js:
function moveSelectedTrends()
{
var selectedTrends = document.getElementById('trends');
for(var i=0; i < selectedTrends.length; i++)
{
alert(selectedTrends.options[selectedTrends.selectedIndex].value) //ONLY returns the first selected element!
}
}