Tell us what’s happening:
I have finished file HTML, CSS, Script.js . After testing the cases following instruction are okay, I clicked “Run to Tests” to finish, the programe is noticed which is not completed (only first - four steps are completed) . How can I completed this Certification ?
My Script.js so far
const checkButton = document.getElementById("check-btn");
const textInput = document.getElementById("text-input");
const resultText = document.getElementById("result");
/***** functional******/
function clearTextInput(){
textInput.value='';
resultText.innerText = '';
resultText.classList.add('hidden');
};
const outPut = input =>{
input = textInput.value;
console.log(input);
if (input ===""){alert("Please input a value ")}else{
const lowerCaseStr = input.replace(/[^A-Za-z0-9]/gi,"").toLowerCase();
let resultMsg = `<strong>${input} </strong>${lowerCaseStr ===[...lowerCaseStr].reverse().join("")?'is':'is not'} a palindrome`;
resultText.classList.remove('hidden');
resultText.innerHTML = `<p class="results-div">${resultMsg}</p><hr>
<button class="btn-clear" onclick="clearTextInput()">Try again</button>`;}
};
checkButton.addEventListener('click',outPut);
WARNING
The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.
You will need to take an additional step here so the code you wrote presents in an easy to read format.
Please copy/paste all the editor code showing in the challenge from where you just linked.
Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.
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 Palindrome Checker Project - Build a Palindrome Checker