title: Simple Age Verification in javascript
body: <p>I'm a total Js noob and i'm trying to make a simple script to take values from two input tags and based on their value change a p tag. I'm probably just not using proper syntax but I can't find an answer online to how to do this.</p>
  
  <p>The script is supposed to be like age verification for an r-rated movie. The first input is age and the second is whether or not the customer has an adult with them for if they are underage.</p>
  
  <pre><code>&lt;pre&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;input type="text" id="age" value="your age"&gt;
      &lt;input type="text" id="adult" value="(y or n)"&gt;
      &lt;input type="button" onclick="checkAge()" value="submit"&gt;
  &lt;p id="answer"&gt;&lt;/p&gt;
  &lt;script&gt;
  var age = document.getElementById("age").innerHTML;
  var adult = document.getElementById("adult").innerHTML;
  var result = document.getElementById("answer").innerHTML;
  var oldEnough = false;
  function checkAge(){
      if(age.value &gt;= 18){
          oldEnough = true;
      }
      else{
          oldEnough = false;
      }
      if(oldEnough == false){
          if(adult.value == "y"){
              result = "You are not old enough, but have an adult with you.";
          }
          else{
              result = "You are not old enough and are unaccompanied."
          }
      }
      else{
          result = "You are old enough."
      }
  }
  &lt;/script&gt;
  &lt;/html&gt;
  &lt;/pre&gt;
  </code></pre>