title: Checking textbox if it's empty in Javascript
body: <p>I wrote a simple html file with a textbox and submit button, and it generates and document.write's a response dependant on what you submit.  I want to have it generate a response saying to enter content if the box is empty.  The textbox's id is chatinput, so I have the following the code in the beginning </p>
  
  <pre><code>    var chatinput_box=document.getElementById('chatinput');
      var chatinput=chatinput_box.value;
  </code></pre>
  
  <p>Then a have a conditional, although I can't get it to work correctly; I've tried</p>
  
  <pre><code>    if(chatinput==""){}
      if(chatinput.length=0){}
      if(chatinput=null){}
  </code></pre>
  
  <p>and others but none have worked correctly.  Does anyone have another idea?</p>