How to get multiple values from a list using java script
The code that you have above is for a specific index. Create a for loop and loop over the index. Get all the values you seek.
Ex:
var arr = "SelectedValues = ";
for(int i=0; i < document.f1.s1.options.length; ++i)
{
arr= arr + "," + document.f1.s1.options[i].value;
}