title: check whether a textarea is empty
body: <p>Can anyone please tell me what the problem is with this code:</p>
  
  <pre><code>function c(id)
  {
      var empty = document.getElementById(id);
      if(empty.length&lt;1)
      {
          window.alert ("This field cant be left empty");
          return true;
      }
      else
      {
          return false;
      }
  
  }
  </code></pre>
  
  <p>This is my html code:</p>
  
  <pre><code>&lt;textarea rows="3" cols="80" id="ta1" onChange="c('ta1');"&gt;&lt;/textarea&gt;
  </code></pre>