title: JavaScript: Detect Alt/Option Key on Select Element
body: <p>I am running this on a Macintosh, hence the <code>option</code> key.</p>
  
  <p>I have a simple menu in HTML as follows:</p>
  
  <pre><code>&lt;select name="select-item"&gt;
      &lt;option value=""&gt;Test&lt;/option&gt;
      &lt;option value="1"&gt;One&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>It is inside a <code>form</code> element which, in JavaScript has the creatively named <code>form</code> variable.</p>
  
  <p>How can I tell whether the option/alt key is down when a menu item is selected?</p>
  
  <p>I have tried the following code:</p>
  
  <pre><code>form['select-item'].onchange=function(e) {
      alert(e.altKey);
  }
  </code></pre>
  
  <p>but I get <code>undefined</code> as the result, regardless of whether the option key is down or not. The same applies if I try the <code>shift</code> key instead.</p>
  
  <p>No jQuery, please.</p>