title: Javascript simple code error
body: <p>Can't seem to find the problem. Every time I run it I get NaN for <code>ageDale</code>, been looking at it for a while now, its probably simple but I appreciate the help!</p>
  
  <pre><code>&lt;p&gt;Enter names in the fields, then click "Submit" to submit the form:&lt;/p&gt;
  &lt;form name="form"&gt;
      &lt;input type="text" id="birthDate"&gt;
  
      Current Date
      &lt;input type="text" id="currentDate"&gt;
  
      &lt;a id="Submit_Button" onclick="test();" href="javascript:void(0);" title="Submit"&gt;Submit&lt;/a&gt;
  &lt;/form&gt;
  &lt;script&gt;
      function test() {
          var birthDate   = document.getElementById("birthDate");
          var currentDate = document.getElementById("currentDate");
          var ageDate     = (birthDate.value - currentDate.value);
  
          if(ageDate.value &lt; 1) {
              (ageDale =  ageDate.value * -1)
          }
          else {
              (ageDale = ageDate.value * 1)
          }
  
          alert(ageDale)
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>Also, is it necessary for me to have that else statement? or is there another way to set up this so its not needed?</p>