title: jQuery .each and trigger keypress to each element
body: <p>So, I have a set of inputs and I need that when certain function is executed it loops all of the inputs and the triggers a keypress event. I do not need just to change the value, I need the keypress event because each input has a "onkeypress" event that I need it to respond to.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id"myinputs"&gt;
  &lt;input name="name" onkeypress="return myfunction(this)" /&gt;
  &lt;input name="name1" onkeypress="return myfunction(this)" /&gt;
  &lt;input name="name2" onkeypress="return myfunction(this)" /&gt;
  &lt;input name="name3" onkeypress="return myfunction(this)" /&gt;
  &lt;input name="name4" onkeypress="return myfunction(this)" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>jQuery</p>
  
  <pre><code>var e = jQuery.Event("keypress");
  e.which = 55;
  e.keyCode = 55;
  $("#myinputs").each(function(index, element)){
  $(element).trigger(e);
  });
  </code></pre>
  
  <p>I hope you guys can help! Thank you!</p>