Finding the value of the selected option in a dropdown
<p>I have the following HTML markup:</p>

<pre><code>&lt;table&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;label&gt;Item Name&lt;/label&gt;&lt;/th&gt;
        &lt;th&gt;&lt;label&gt;Quantity&lt;/label&gt;&lt;/th&gt;
     &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="text" class="itemized-list-item" size="20"/&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select&gt;
                &lt;option class="quantity" value="1"&gt;1&lt;/option&gt;
                &lt;option class="quantity" value="2"&gt;2&lt;/option&gt;
                &lt;option class="quantity" value="3"&gt;3&lt;/option&gt;
                &lt;option class="quantity" value="4"&gt;4&lt;/option&gt;
                &lt;option class="quantity" value="5"&gt;5&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="text" class="itemized-list-item" size="20"/&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select&gt;
                &lt;option class="quantity" value="1"&gt;1&lt;/option&gt;
                &lt;option class="quantity" value="2"&gt;2&lt;/option&gt;
                &lt;option class="quantity" value="3"&gt;3&lt;/option&gt;
                &lt;option class="quantity" value="4"&gt;4&lt;/option&gt;
                &lt;option class="quantity" value="5"&gt;5&lt;/option&gt;
            &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I tried the following to get the item value in the input type and the selected quantity option in the dropdown:</p>

<pre><code>var quantity;
var item;
$('.itemized-list-item').each(function() {
    item = $(this).val();
    quantity = $(this).next('.quantity:selected').attr('value');
}
</code></pre>

<p>I get the item value but not the selected option.</p>

<p>I have tried many methods for hours but no avail. I hope someone can shed some light on where I am going wrong.</p>

<p>Cheers,
nav</p>
