title: How can I check if the input is empty in JavaScript?
body: <p>I am trying to make a <strong>factorial calculator</strong>. How can I check if the input is empty or not? I tried 'null'. But it didn't work or I couldn't use it properly.<br/>
  sorry for the stupid question. I am newbie in <strong>JavaScript</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myFriday() {
    var input = document.getElementById("input1").value;
  
    var ever = function () {
      if( !(isNaN(input))) {
        var result = 1;
        for(var i = 1; i &lt;= input; i++ ) {
          result = result * i
        }
        return result;
      }
      else if (input == null){
        return "Please input a number"
      }
      else{
        return "Please input a number"
      }
    }
  
    document.getElementById("input2").value = ever();
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;Input: &lt;input type="text" id = "input1" /&gt;&lt;/p&gt;
  &lt;p&gt;Input: &lt;input type="text" id = "input2" /&gt;&lt;/p&gt; 
  &lt;button onclick = "myFriday()"&gt;Calculate&lt;/button&gt;
  &lt;p &gt;RESULT: &lt;span id = "result" style = "color:red"&gt;&lt;/span&gt; &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>