Get selected value from select tag
<p>When I select a value from the option and click on a button, I want to fetch the selected value with javascript. What am I doing wrong? My value is always 1.     </p>

<pre><code> &lt;select id="aand_select"&gt;
                            &lt;option value="1"&gt;1&lt;/option&gt;
                            &lt;option value="2"&gt;2&lt;/option&gt;
                            &lt;option value="3"&gt;3&lt;/option&gt;
                            &lt;option value="4"&gt;4&lt;/option&gt;
                            &lt;option value="5"&gt;5&lt;/option&gt;
    &lt;/select&gt;
</code></pre>

<p>// javascript code</p>

<pre><code>var e = document.getElementById("aand_select");
var quantity= e.options[e.selectedIndex].value;
</code></pre>
