get value from drop down that is not hidden
<p>I am very new to JavaScript and JQuery so there may be a very simple solution to my problem. What I want to do is print out the unit number that is selected to the screen. The unit numbers change depending on what machine type is selected, the unit number drop down specific to the machine type is un-hidden when the machine type is selected. How can I tell JavaScript or JQuery to print the value selected in the unit number drop down? </p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;

&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
        &lt;title&gt;Test&lt;/title&gt;
        &lt;script src="../jquery-1.8.3.js"&gt;&lt;/script&gt;
        &lt;script src="jsFunctions.js" type="text/javascript"&gt;&lt;/script&gt;
        &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /&gt;
        &lt;link media="Screen" href="timeCard.css" type="text/css" rel="stylesheet" /&gt;
        &lt;link media="only screen and (max-device-width: 480px) and (min-device-width: 320px)" href="mobile.css" type="text/css" rel="stylesheet" /&gt;
    &lt;/head&gt;
    &lt;body&gt;

            &lt;h1&gt;What do you want to do?&lt;/h1&gt;
            &lt;div id="buttons"&gt;
       &lt;button type="submit" id="punchIn" onclick="timeIn()"&gt;Clock In&lt;/button&gt;
       &lt;button type="submit" id="updateJob" onclick="updateJob()"&gt;Update&lt;/button&gt;
       &lt;button type="submit" id="punchOut" onclick="timeOut()"&gt;Clock Out&lt;/button&gt;
       &lt;/div&gt;

       &lt;div id="content"&gt;

       &lt;label id="jobDesc" style="display: none"&gt;Job Description&lt;/label&gt;
           &lt;input type="text" id="jobDescription" style="display: none"/&gt;

       &lt;label id="equipRan" style="display: none"&gt;Equipment ran&lt;/label&gt;
            &lt;select size="1" name="equipmentList" title="" id="equipmentList" style="display: none"&gt;
                &lt;option value=""&gt;Select Machine&lt;/option&gt;
                &lt;option value="EX"&gt;Excavator&lt;/option&gt;
                &lt;option value="DZ"&gt;Dozer&lt;/option&gt;
                &lt;option value="SC"&gt;Scraper&lt;/option&gt;
            &lt;/select&gt;

       &lt;div class="unitDropDowns"&gt;
          &lt;div class="EX"&gt;
            &lt;select class="exUnitNumbers"&gt;
                &lt;option value=""&gt;Unit number&lt;/option&gt;
                &lt;option value="01E"&gt;01E&lt;/option&gt;
                &lt;option value="2E"&gt;2E&lt;/option&gt;
                &lt;option value="4E"&gt;4E&lt;/option&gt;
            &lt;/select&gt;           
        &lt;/div&gt;

            &lt;div class="DZ"&gt;
                &lt;select class="dzUnitNumbers"&gt;
                    &lt;option value=""&gt;Unit number&lt;/option&gt;
                    &lt;option value="01D"&gt;01D&lt;/option&gt;
                    &lt;option value="2D"&gt;2D&lt;/option&gt;
                    &lt;option value="1D"&gt;1D&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;

            &lt;div class="SC"&gt;
                &lt;select class="scUnitNumbers"&gt;
                    &lt;option value=""&gt;Unit number&lt;/option&gt;
                    &lt;option value="54C"&gt;54C&lt;/option&gt;
                    &lt;option value="53C"&gt;53C&lt;/option&gt;
                    &lt;option value="52C"&gt;52C&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;

       &lt;/div&gt;

       &lt;button type="submit" id="updateButton" onclick="dbQuery()" style="display: none"&gt;Submit&lt;/button&gt;

       &lt;div id="summary"&gt;
            &lt;div id="timeDiv" style="color: red;"&gt;&lt;/div&gt;
            &lt;div id="descriptionSummary" style="display: none"&gt;&lt;/div&gt;      
            &lt;div id="equipmentRan" style="display: none"&gt;&lt;/div&gt;
       &lt;/div&gt;

      &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Javascript file</p>

<pre><code>    $(document).ready(function() {
    $('#equipmentList').bind('change', function() {
    var elements = $('div.unitDropDowns').children().hide(); // hide all the elements
    var value = $(this).val();

        if (value.length) { // if somethings' selected
            elements.filter('.' + value).show(); // show the ones we want
        }
        }).trigger('change');
});

var timeIn = function() {

    var clockIn = new Date();
    timeDiv.innerHTML = clockIn;
}

var timeOut = function(){

    var clockOut = new Date();
    timeDiv.innerHTML= clockOut;
    document.getElementById("equipmentList").style.display = "block";
    document.getElementById("jobDescription").style.display = "block";
    document.getElementById("jobDesc").style.display = "block";
    document.getElementById("equipRan").style.display = "block";
}
var updateJob = function(){
    document.getElementById("jobDescription").style.display = "block";
    document.getElementById("updateButton").style.display = "block";
    document.getElementById("equipmentList").style.display = "block";
    document.getElementById("jobDesc").style.display = "block";
    document.getElementById("equipRan").style.display = "block";
}

var dbQuery = function(){
    var description = document.getElementById("jobDescription").value;
    var selectedEquip = document.getElementById("equipmentList");
    var selectedEquip1 = selectedEquip.options[selectedEquip.selectedIndex].text;
    document.getElementById("descriptionSummary").innerHTML = "&lt;h3&gt;Description&lt;/h3&gt;" + "&lt;p&gt;" + description + "&lt;/p&gt;";
    document.getElementById("equipmentRan").innerHTML = "&lt;h3&gt;Equipment Ran &lt;/h3&gt;" + "&lt;p&gt;" + selectedEquip1 + "&lt;/p&gt;";
    document.getElementById("equipmentRan").style.display = "block";
    document.getElementById("descriptionSummary").style.display = "block";
}
</code></pre>
