Build a Telephone Number Validator Project - Build a Telephone Number Validator

The problem is that I enter the input, click the check button and it displays “please provide a number phone”

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./styles.css">
<title>Palindrome</title>
  </head>
  <body>
    <h3>Valid Number Operation</h3>
    <p>
      <h1>Enter a Phone Number
      <input id="user-input" class="ipt" type="number"></input>
      <p>
        <button id="check-btn" class="btnn">Check</button> 
        <button id="clear-btn" class="btnn">Clear</button> 
      <div class="results-divv" id="results-div"></div>
      </p>
      </h1>
    </p>
    <script src="script.js"></script>
  </body>
</html>
/* file: styles.css */
h3 {
  text-align: center;
  font-size: 35px;
  color: #00FFFF;
}
body {
  background-color: #2e2d2d;
}
h1, h2 {
  text-align: center;
  background-color: #4b586b;
  border-radius: 17px;
  color: #00BFFF;
}
.btnn {
  font-weight: bold;
  width: 60px;
  height: 26px;
  border-radius: 7px;
  text-align: center;
  color: #4169E1;
}
h2 {
  color: #1E90FF;
}
.ipt {
  font-weight: bold;
  text-align: center;
  color: #4169E1;
}
/* file: script.js */
const userInput = document.getElementById('user-input');
const checkBtn = document.getElementById('check-btn');
const clearBtn = document.getElementById('clear-btn');
const results = document.getElementById('results-div');

const someValue = userInput.value;

const checkValidNumber = () => { 
  const firstNum = /1 555-555-5555/;
  const secondNum = /1 (555) 555-5555/;
  const thirdNum = /1(555)555-5555/;
  const fourthNum = /1 555 555 5555/;
  const fifthNum = /5555555555/;
  const sixthNum = /555-555-5555/;
  const seventhNum = /(555)555-5555/;

  const allNum = [firstNum, secondNum, thirdNum, fourthNum, fifthNum, sixthNum, seventhNum];

  const validNum = num => allNum.some((regex) => regex.test(num));

  if (someValue === '') {
    alert('Please provide a phone number');
  } else if
  (someValue === validNum) {
    results.innerHTML = 'Valid US number: ' + someValue;
  } else {
    result.innerHTML = 'Invalid US number: ' + someValue;
  }
  
};

const clearFun = () => {
  results.innerHTML = '';
};

checkBtn.addEventListener('click', checkValidNumber);
clearBtn.addEventListener('click', clearFun)


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

Challenge Information:

Build a Telephone Number Validator Project - Build a Telephone Number Validator

you are locking here which value of userInput.value you are comparing later. Get the value of userInput.value when you need it, instead of doing this assignment here