title: Javascript: Get array value when I select the option in the drop down list
body: <p>I hope that someone would be able to help me to solve this simple problem.</p>
  <p>My goal is to get the value in the array from selection drop down list.</p>
  <p>Basically, I create an Array in Javascript and a selection drop down list in the body.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
      var even = new Array(2, 4, 6);
  &lt;/script&gt;
  .
  .
  .
  &lt;select id=&quot;evenNumbers&quot;&gt;
       &lt;option value=&quot;1&quot;&gt;two&lt;/option&gt;
       &lt;option value=&quot;2&quot;&gt;four&lt;/option&gt;
       &lt;option value=&quot;3&quot;&gt;six&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  <p>My question is how can I get the value in the Array if I select the option from the drop down list? e.g. when I select &quot;two&quot; from the drop down list, but I can get the value of &quot;2&quot; in the array in order to do some calculation.</p>