title: Get the character count of a textarea including newlines
body: <p>I tested this code in Chrome and there seems to be a bug involving the newlines. I am reaching the maxlength before I actually use all the characters.</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>var ta = document.getElementById('myText');
  
  document.getElementById('max').innerHTML = ta.maxLength;
  
  setInterval(function() {
      document.getElementById('count').innerHTML = ta.value.length;
  }, 250);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;textarea id="myText" maxlength="200" style="width:70%;height:130px"&gt;
  Lorem Ipsum is simply dummy text of the printing and typesetting industry.
  Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
  Type more words here...
  &lt;/textarea&gt;
  
  &lt;div&gt;
      Char Count &lt;span id="count"&gt;0&lt;/span&gt;/&lt;span id="max"&gt;0&lt;/span&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can I accurately get the char count of a textarea?</p>
  
  <p><strong>Update 1</strong>
  I reported the <a href="https://code.google.com/p/chromium/issues/detail?id=158652" rel="nofollow noreferrer">bug</a> to the Chromium team and it seems to be low priority.</p>
  
  <p><strong>Update 2</strong>
  That bug was merged into another <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=252613" rel="nofollow noreferrer">bug</a>.</p>
  
  <p><strong>Update 3</strong>
  The bug appears to be fixed!</p>