title: Javascript - enabling button when input is filled
body: <p>I want to enable my button, when input is filled. I want to do it in pure Javascript.</p>
  
  <p>My code example in HTML:</p>
  
  <pre><code>&lt;form action="sent.php" method="post" name="frm"&gt;
    &lt;input type="text" name="name_input" id="name" onkeyup="myFunction()"&gt;&lt;br&gt;
    &lt;button type="submit" class="button button-dark" id="send"&gt;Send message&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And Javascript:</p>
  
  <pre><code>document.addEventListener("DOMContentLoaded", function(event) {
      document.getElementById('send').disabled = "true";
      function myFunction() {
          var nameInput = document.getElementById('name').value;
          if (!nameInput === "") {
              document.getElementById('send').disabled = "false";
          } 
      }
  });
  </code></pre>
  
  <p>I don't know why my button is not changing to enable state after filling something in input. I have tried diffrent ways to do it, but it's still not working.
  Please help.</p>