Here I have been attempting the problem of Build a palindrome checker, and it passes every single one of the test cases so far EXCEPT for the 4th test case, which states the following:
When you click on the #check-btn element without entering a value into the #text-input element, an alert should appear with the text Please input a value .
This has been copied word to word from the page. This is the only test case I do not pass, yet on preview, I see that it does perform the desired functionality. Could someone please help me figure this out please? (I may be missing something incredibly dumb, please forgive me for that )
(I’ve excluded the code for checkPalindrome function because that is not related to the issue at hand.)
I’m confused by this function. Is the alert actually showing up for you? Why put a function inside of a function instead of just having the target behavior in your clickyBoi function?
Oh, I just realised what’s going on… I’m really sorry about the confusion. I just figured it out after reading your message. Initially it wasn’t inside a function actually, later on I just thought why not put it inside a function but I kinda messed up as you see. Thanks for helping JeremyLT & bbsmooth!
For all of you that are wondering why your code does not pass further than the 3rd test and doesn’t run anything in the console, it’s because you have to link the javascript, or use the script tag right in the HTML.