Hi there. I’m having a problem with the third certification project for “Javascript Algorithms & Data Structures”: " Build a Telephone Number Validator". Here’s what happened:
I completed the code, ran the tests, and (eventually) passed all the tests.
After passing the tests, I did not hit “submit” to go to the next challenge.
I made minor changes to the code.
I ran the tests, and all of the tests failed. This is the problem.
I’ve read on the forums somewhere that it was a mistake to not hit “submit” after passing the tests and before changing and re-testing the code. Can you help me fix it please?
What I’ve tried so far:
Deleting all the code, then using the “Save your code” button, then re-testing, then pasting my code back in and then re-testing
Restarting the browser
Clearing the browser’s history for the time period during which I was working on this project
Logging out on all browsers/devices, and logging back in
My code is failing literally every single test, including, for example, " You should have an input element with an id of ‘user-input’", even though that element is present in my code and hasn’t changed since I initially passed all the tests. So I suspect it’s a problem with the site (that might have been caused by me doing something weird?) and not a bug that needs to be fixed in my code.
Edit to add: I tried starting two other projects. In both cases, I couldn’t get past the first step because the page said my code didn’t pass.
For example: Start by using "document.getElementById()" to get the "#start-btn" and "#canvas" elements. Store them in "const" variables named "startBtn" and "canvas" respectively.
My code that failed: const startBtn = document.getElementById("#start-btn"); const canvas = document.getElementById("#canvas");
Hi,
It might be that your code is incorrect. const startBtn = document.getElementById("#start-btn"); # is used in CSS selectors for id of an element. But for Js, just add the ID name of the element inside the parentheses.
Try that and see if it’s still failing. We will work to solve it together.
Good luck!
Well, that’s embarrassing. Unfortunately I’m still having the problem with the original certification not passing tests; but at this point I think I’d better check all my code with a fine-toothed comb before I come back to the formus. Thanks for all your help.