title: Live preview of textarea input with javascript html
body: <p>Hi I am setting up a live preview of the input of a textarea which will be posted to a blog. I currently have this set up</p>
  
  <pre><code>&lt;textarea name="WPcomment" id="WPComment" placeholder="Add comments:" onkeypress="document.getElementById('prevCom').innerHTML = this.value"&gt;&lt;/textarea&gt;
  
  &lt;div id="prevCom"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The issue is that the preview is one character behind the input of the textarea. For instance if i write "my comment" I see "my commen"</p>
  
  <p>Thanks for your help!</p>