title: Putting value of "select" tag into JavaScript variable
body: <p>Sample of <code>&lt;select&gt;</code> HTML form element from <a href="http://www.w3schools.com/tags/tag_select.asp" rel="nofollow">W3Schools</a> (a bit modified):</p>
  
  <pre><code>&lt;select&gt;
    &lt;option value="a"&gt;Option A&lt;/option&gt;
    &lt;option value="b"&gt;Option B&lt;/option&gt;
    /*...*/
  &lt;/select&gt;
  </code></pre>
  
  <p>As far as I could see, neither <code>option</code> nor <code>select</code> has <code>id</code> property, so the good old <code>document.getElementById("name of select element").value</code> does not work.</p>
  
  <p>But then, how can I put the <code>value</code> attribute of the option that is <strong>selected</strong> in the list into a JS variable?</p>
  
  <p>I'm aware that it can be done by a function call, e.g. when I push a button element, but what do I have to write into that function?</p>