not sure why the 1 st and second task arent passing there right there on lines 11 & 12 im pretty sure the syntax is right and i double checked the spelling should be right am i missing somthing or is this a bug.
im confused in your post concerning missing the if opening bracket the opening bracket should be in front of the the if an example being {if however i n your next post you say the alert method should be between the if and the body {} indicatating there are two opening brackets right ?
const checkButton = document.getElementById("check-btn");
const textInput = document.getElementById("text-input");
const resultDiv = document.getElementById("result");
checkButton.addEventListener("click", () => {
const inputValue = textInput.value.toLowerCase();
if (inputValue === ""){
alert("Please input a value");
} else if (inputValue === "a") {
resultDiv.textContent
="A is a palindrome";
} else if (inputValue=== "eye") {
resultDiv.textContent = "eye is a palindrome";
} else if ( inputValue === "_eye"){
resultDiv.textContent = "_eye is a palindrome";
} else if (inputValue === "race car"){
resultDiv.textContent = "race car is a palindrome";
} else if (inputValue === "not a palindrome"){
resultDiv.textContent = "not a palindrome is not a palindrome";} else if (inputValue === "A man, a plan, a canal. panama"){
resultDiv.textContent = "A man, a plan, a canal. Panama is a palindrome"
} else{resultDiv.textContent = "";
}
});
You can’t hard code the functionality for checking palindrome. You need to utilize a function that can check for palindrome. Your palindrome should check anything whatever the user type in the input.