Telephone validator

This is my code for the phone validator I just cant seem to get past more then a few numbers and I tried as much as I could think of any suggestions please.

const userInput = document.getElementById("user-input");
    const checkBtn = document.getElementById("check-btn");
    const clearBtn = document.getElementById("clear-btn");
    const resultsDiv = document.getElementById("results-div");

    checkBtn.addEventListener('click', function() {
        const inputValue = userInput.value.trim();
        if (inputValue === "") {
            alert("Please provide a phone number");
            return;
        }

      
const regex = /^((1\s){0,1}\d{3}-\d{3}-\d{4}|((1\s){0,1}|1)\(\d{3}\)\s{0,1}\d{3}-\d{4}|(1\s){0,1}\d{3}\s\d{3}\s\d{4}|\d{10})$/;

if (regex.test(inputValue)) {
            resultsDiv.textContent = "Valid US number: " + inputValue;
        } else {
            resultsDiv.textContent = "Invalid US number: " + inputValue;
        }
    });

    clearBtn.addEventListener('click', function() {
        userInput.value = "";
        resultsDiv.textContent = "";
    });
});

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

If what you pasted above is your exact code then I would open the console pane and look for error messages in there. One easy fix and I was able to get your code to pass.