title: Javascript button ceases to write to texarea once user has added text
body: <p>I am trying to make a simple text editing box so that I can eventually post text to another section of a website. I'm attempting to make buttons to make text bold, italicized, add a code box etc, (hence <code>insertAdjacentHTML</code> not <code>insertAdjacentText</code>) but I decided to just start making sure I could get plain text to print to a textarea.
  I have achieved this easily but now my question becomes how do I make it so that the button still affects the text area after a user has added text to it? the code below will happily type out "hello"'s up until you click on the textarea, and from that point on it refuses to and I can't figure out why.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>window.hello = function(textarea) {
    var obj = document.getElementById("text");
    obj.insertAdjacentHTML('beforeend', 'hello');
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;button onclick="hello()"&gt;hello&lt;/button&gt;
    &lt;form&gt;
      &lt;p&gt;&lt;/p&gt;
      &lt;textarea id="text"&gt;&lt;/textarea&gt;
    &lt;/form&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>