title: Javascript/HTML textarea count letters (no spaces) and words
body: <p>I'm a coding noob...I'm working on an assignment to create a textarea that will capture the user input then calculate the characters (excluding spaces) and calculate the word count.
  It does everything but the final character/word count.<br>
  Can anybody please help me with what I'm missing.</p>
  
  <pre><code>&lt;table border="0" cellspacing="0" cellpadding="0"&gt;
    &lt;td width="100%"&gt;
      &lt;textarea rows="12" name="charcount" cols="60" wrap="virtual"&gt;&lt;/textarea&gt;
    &lt;/td&gt;
    &lt;tr&gt;
      &lt;td width="100%"&gt;
        &lt;div align="center"&gt;
          &lt;p&gt;
            &lt;input type="button" value="Calculate Characters" onClick="countit(this)"&gt;
            &lt;input type="text" name="displaycount" size="20"&gt;
          &lt;/p&gt;
          &lt;div align="center"&gt;
            &lt;center&gt;
              &lt;font face="arial" size="-2"&gt;
            &lt;/center&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;td width="100%"&gt;
      &lt;div align="center"&gt;
        &lt;p&gt;
          &lt;input type="button" value="Calculate Words" onClick="countit()"&gt;
          &lt;input type="text" name="wordcount3" size="20"&gt;
        &lt;/p&gt;
      &lt;div align="center"&gt;
        &lt;center&gt;&lt;/center&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>