title: How to automatically press 'Enter' key on change in value in textarea (using Pure JS)?
body: <p>For the automated robot framework tests, I need to trigger the <code>Enter</code> keypress automatically on updating the value in the <code>textarea</code> using pure JavaScript. (in Console)</p>
  <p>Tried the following, but didn't worked</p>
  <pre><code>function simulateEnterPress(element) {
      e = $.Event(&quot;keypress&quot;); // Create a keypress event
      e.which = 13; // Set the pressed key to &quot;Enter&quot;
      element.trigger(e); // Trigger the event
  }
  function doAction() {
      inputElement = document.getElementById(&quot;vJSONValue&quot;).value; // Get the input element
      inputElement.value = ('[{&quot;label&quot;:&quot;oook&quot;}]'); // Set value of the input
      simulateEnterPress(inputElement);
  }
  </code></pre>
  <p><strong>Updated:</strong></p>
  <blockquote>
  <p>Need to update the <code>JSONeditor</code> through <code>textarea</code> <a href="https://i.stack.imgur.com/HaXzM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HaXzM.png" alt="enter image
  description here" /></a></p>
  </blockquote>