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

Tell us what’s happening:

Hi communities,

I worked on this certification project, then I switched to another one because of these two tests I can’t pass. Pls, I need your help on this one.
35. When the #user-input element contains a valid US number and the #check-btn element is clicked, the #results-div element should contain the text "Valid US number: " followed by the number.
Second one is similar with "Invalid US number: "
Maybe something I don’t see? I didn’t use the {} regex because I wanted to do without.
Thanks

Your code so far

<!-- file: index.html -->

/* file: script.js */

/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0

Challenge Information:

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

You may notice that there are a couple of “undefined variable” errors, there is a bug in the tests where they have not defined their own variables and are relying on the ones you have created, but you have used different names (you did perfectly fine, the bug is in the tests)

The variables you would need to use are these:

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

It works fine
Thanks a lot