title: Make sure an input field has a value before submit
body: <p>I want to make sure that the input has value before submit but when I use "" or 'null', it, null will not disable it and "" will keep it disabled no matter what.
  Here is my code:</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 prevScrollpos = window.pageYOffset;
  $(window).scroll(function() {
    var currentScrollPos = window.pageYOffset;
    if (prevScrollpos &gt; currentScrollPos) {
      $("#container").fadeIn();
    } else {
      $("#container").fadeOut();
    }
    prevScrollpos = currentScrollPos;
  
  });
  if (document.getElementById("m").value === null) {
    document.getElementById("send").disabled = true;
  } else if (document.getElementById("m").value !== null) {
    document.getElementById("send").disabled = false;
  } else {
    $(function() {
      var socket = io();
      $('form').submit(function() {
        socket.emit('chat message', $('#m').val());
        $("#m").val("");
        return false;
      });
      socket.on('chat message', function(msg) {
        $('#messages').append($('&lt;li&gt;').text(msg));
  
      });
    });
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/jquery-1.11.1.js"&gt;&lt;/script&gt;
  &lt;div id="msgs"&gt;
    &lt;ul id="messages"&gt;&lt;/ul&gt;
  &lt;/div&gt;
  &lt;form action=""&gt;
    &lt;div id="container"&gt;
      &lt;input id="m" autocomplete="off" /&gt;&lt;button id="send"&gt;Send&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>thanks!</p>