I have written some javascript code to loop through an array of element ids and find them in the document object, using getElementById(). The code is written to validate that all the elements pointed to by the array of ids have been "filled-in" by the client.

When accessing via HTML, by using Request.Form("NameOfSelectTag"), I can just get the value, like any text input. But accessing it through the DOM seems to be trickier.

It is easy enough when dealing with input elements (text) but, I am having a difficult time figuring out how to get the value of a select element that has option elements as children. How do I determine which (if any) options was selected?
Here is the code from my .js file:

Code:
function validate(doc, a){
    var s;
    for(var i = 0; i < a.length; i++){
        if(doc.getElementById(a[i]).nodeName == "SELECT"){
            //now that I have found a SELECT item, how do I find out which, 
            //if any, of its options was selected?
        }
        else{//it is a text input
            s = doc.getElementById(a[i]).value;
            if(s.replace(/ /g, "") == ""){
                //if the text = "" then alert the user to put a value in.
                //I am doing this part o.k.

            }
        }
    }
}
Thanks, in advance for any help you can provide.