title: Check if a textarea changes, and if so, write it's value somewhere
body: <p>I have one textarea <code>#text-g</code> and one div <code>#textg</code>. I'd like to make a script for when the textarea changes (Someone type in it), the div display the text. </p>
  
  <p>I've made this pretty simple code, but of course it's not working because there's no event.</p>
  
  <pre><code>function myFunction() {
  var text1 = document.getElementById('text-g').value; 
  document.getElementById('textg').value = text1.val;
  }
  </code></pre>
  
  <p>Could someone please explain me how these events work ? 
  And does my two-codes are enough, with the event, to do what I would like to achieve ? </p>