title: Onsubmit event silently killed by onchange
body: <p>Onsubmit event can silently kill onchange event, if called simultaneously. I assume race condition in js engine. Tested in chrome, FF3, FF6 and IE9.</p>
  
  <p>To reproduce you need to change contents of input and click on submit button. Do not make any additional clicks between input change and submit button click.</p>
  
  <pre><code>&lt;div id="somediv"&gt;
      &lt;div&gt;one&lt;/div&gt;
      &lt;div&gt;two&lt;/div&gt;
  &lt;/div&gt;
  &lt;form method="POST" id="someform"&gt;
      &lt;input type="text" name="input1" id="someinput" value="change me" /&gt;         
      &lt;input type="submit" /&gt;
  &lt;/form&gt;
  &lt;script type="text/javascript"&gt;
      document.getElementById('someinput').onchange = function() {
          //some delay - DOM operations, AJAX or alert:
          document.getElementById('somediv').getElementsByTagName('div')[1].style.display = 'none';
          //or alert('123');
      }
      document.getElementById('someform').onsubmit = function() {
          alert('This event is not called');
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Expected behavior: onchange event, than onsubmit.</p>
  
  <p>If we use button instead of submit and call events one after another - everything works as expected.</p>
  
  <p>If there is no operations (no delay) in onchange event - works as expected.</p>
  
  <p>If onchange will change div's color (not display) - <strong>sometimes</strong> (3/10) works as expected, lol.</p>
  
  <p>js-guru, please, explain, what the hell is going on?</p>