title: Set React Input Field Value from JavaScript or JQuery
body: <p>How can you programmatically set the value of an input field generated by React, either with vanilla JS or JQuery?</p>
  
  <p>I've tried the following and nothing seems to work.</p>
  
  <pre><code>$(obj).val('abc');
  $(obj).attr('value', 'abc');
  $(obj).keydown();
  $(obj).keypress();
  $(obj).keyup();
  $(obj).blur();
  $(obj).change();
  $(obj).focus();
  </code></pre>
  
  <p>I've also tried to simulate <code>keyPress</code> (as suggested <a href="https://github.com/airbnb/enzyme/issues/76" rel="noreferrer">here</a>) events but it doesn't seem to work either.</p>
  
  <pre><code>simulateKeyPresses (characters, ...args) {
    for (let i = 0; i &lt; characters.length; i++) {
      this.simulate('keyPress', extend({
        which: characters.charCodeAt(i),
        key: characters[i],
        keyCode: characters.charCodeAt(i)
      }, args));
    }
  }
  </code></pre>