If statement not working correctly in Javascript

I’ve written a program that should display an image of a beverage or an alert window depending on the user’s age input. The problem is that regardless of what value is submitted it only executes the ‘if’ portion of the statement. None of the other conditions are being checked prior to execution. I have tried using getElementById with the element id in place of querySelector but the program did not run at at all. I have tried querySelector with the button tag as well as trying the input tag. That also did not work.

function strt() {
  let theButton = document.getElementById('aButton');
  theButton.addEventListener('click', verifyAge);
}

function verifyAge() {
  let patronAge = document.querySelector('age');
  let primaryImg = document.getElementById('mainImg');

  if (patronAge < 21) {
    primaryImg.src = 'images/cola.jpg';
  } else if (patronAge >= 21) {
    primaryImg.src = 'images/tallboy.jpg';
  } else if (patronAge <= 0) {
    alert('Please enter a valid number:');
  } else if (patronAge == NaN) {
    alert('That is not a valid number. Please try again.');
  }
}
window.addEventListener('load', strt);
<img src="images/bar&grill.png" alt="barandgrill" id="mainImg">
<br>
<form>
  <label for="age">Please enter your age:</label>
  <input type="text" id="age" required>
  <button id="aButton" type="button">Get Drinks</button>
</form>

Answer

couple of minor problems. They are pretty easy to spot. Look over the snippet and let me know if you don’t understand anything.

function strt() {
  let theButton = document.getElementById('aButton');
  theButton.addEventListener('click', verifyAge);
}

function verifyAge() {
  let patronAge = document.getElementById('age').value;
  let primaryImg = document.getElementById('mainImg');  
  
  if (patronAge < 21) {
    primaryImg.src = 'https://via.placeholder.com/120';
  } else if (patronAge >= 21) {
    primaryImg.src = 'https://via.placeholder.com/150';
  } else if (patronAge <= 0) {
    alert('Please enter a valid number:');
  } else if (typeof(patronAge) == 'string') {
    alert('That is not a valid number. Please try again.');
  }
}
window.addEventListener('load', strt);
<img src='https://via.placeholder.com/100' alt="barandgrill" id="mainImg">
<br>
<form>
  <label for="age">Please enter your age:</label>
  <input type="text" id="age" required>
  <button id="aButton" type="button">Get Drinks</button>
</form>