title: JavaScript trigger an InputEvent.isTrusted = true
body: <p>I'm trying to automatize some tasks in <strong>JavaScript</strong> and I need to use a <code>InputEvent</code>, but when I use normal event, I'm getting <strong>event.isTrusted = false</strong> and my event is doing nothing. Here is my event code:</p>
  <pre><code>var event = new InputEvent('input', {
      bubbles: true,
      cancelable: false,
      data: &quot;a&quot;
  }); 
  
  document.getElementById('email').dispatchEvent(event);
  </code></pre>
  <p>This code should put &quot;a&quot; into a textField with id &quot;email&quot;, but when event.isTrusted = false, this code is doing <strong>nothing</strong>. I'm testing it in Chrome Developer Tools in Sources tab with Event Listener Breakpoints (I checked only keyboard&gt;input breakpoint and it shows me all attributes of used event).
  I checked all attributes from real keyboard click and only thing that is different is event.isTrusted.</p>
  <p>What can I change or what can I do to get <strong>event.isTrusted = true</strong>?</p>