title: jQuery store input element
body: <p>I am making an angularjs app, and I am checking all clicks on the document:</p>
  
  <pre><code>  $(document).click(function(event) {
  
      if(event.target.nodeName == "INPUT") {
  
          // get and store the element itself
  
      }
    });
  </code></pre>
  
  <p>And later on I want to trigger keyevent in order to change the value of the input element</p>
  
  <pre><code>var findInput = function (element) {
      return element.find('input');
  };
  
  var triggerKeyDown = function (element, keyCode) {
      var inputEl = findInput(element);
      var e = $.Event('keydown');
      e.which = keyCode;
      inputEl.trigger(e)
  };
  </code></pre>
  
  <p>I've tried multiple times to extract the element from the event using "target" and "toElement" members of the event structure.
  So any idea how to do this</p>