title: HTML -How to do error checking for null value input of textarea in javascript?
body: <p>I want to do some error checking in the script for the input of a textarea, i.e. if there is no input, showing an alert. I've tried to use value="" value='' , but seems all cannot work. </p>
  
  <p>Field</p>
  
  <pre><code> &lt;div class="field"&gt;
          &lt;label&gt;remarks:&lt;/label&gt;
          &lt;textarea id="id_remarks" name="remarks"&gt;&lt;/textarea&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>Save button</p>
  
  <pre><code>&lt;input type="submit" value="Save" onclick="verify()"/&gt;
  </code></pre>
  
  <p>Function</p>
  
  <pre><code>&lt;script&gt;    
      function verify(){
      if (document.forms[0].elements['id_remarks'].value=='') {
          alert('Please enter the remarks')
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Can anyone help on how to do it? thanks very much</p>