title: How to detect "enter-key press in input clicks next button" behavior using JavaScript in IE 8-10
body: <p>I am trying to "feature detect" IE's behavior when pressing enter in an input box that has a button element next to it (when they are not in a form element).</p>
  
  <p>I'm saying IE's behavior because no one else fires a click event on the next button when pressing the enter-key while the input is focused.</p>
  
  <p>Related question where the first awnser describes why IE behaves like this:
  <a href="https://stackoverflow.com/questions/10739525/ie-bug-triggers-click-for-2-buttons">IE bug triggers click for 2 buttons?</a></p>
  
  <p>JS-Fiddle where I try to simulate the key press via jQuery.Event and .trigger:
  <a href="http://jsfiddle.net/DbVrn/" rel="nofollow noreferrer">http://jsfiddle.net/DbVrn/</a></p>
  
  <p>Behavior of said js-fiddle in IE:</p>
  
  <ul>
  <li>When opening the page, the input gets focus, and then we try to simulate pressing of the enter-key.</li>
  <li>The simulated enter-key does nothing, hence the input remains focused and red.</li>
  <li>If you manually press enter while the input is focused, the button will become focused and green.</li>
  </ul>
  
  <p>The problem i have with my current attempt to detect this feature is that:</p>
  
  <pre><code>$("input").trigger(jQuery.Event("keypress", { which: 13 }));
  </code></pre>
  
  <p>does not actually do the same as manually pressing the enter-key while the input is focused.</p>
  
  <p>How can I successfully simulate the enter-key so that my test for this behavior is possible?
  Or is there another way i can test for this behavior?</p>
  
  <p><strong>Edit:</strong> Updated title to more clearly state that this needs to be tested via javascript, and that the test needs to work in IE from version 8 to 10. Unless anyone else can provide a way of testing this, I will conclude that I need to use user-agent sniffing to see if browser is IE and choose code-path based off that.</p>