Tell us what’s happening:
i need help with talks 18 and 19, cant seem to figure out the code. thanks in advance
Your code so far
<!-- file: index.html -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css"/>
</head>
<body>
<input id="text-input"></input>
<button id="check-btn"></button>
<div id="result">
</div>
<script src="script.js">
</script>
</body>
</html>
/* file: styles.css */
/* file: script.js */
const checkBtn = document.getElementById("check-btn");
const textInput = document.getElementById("text-input");
const result = document.getElementById("result");
//checks for NO INPUT VALUE
function checkButton() {
if (textInput.value === "") {
alert("Please input a value");
}
}
checkBtn.addEventListener("click",checkButton);
//checks if its an A
function checkA(){
if (textInput.value === "A"){
result.innerText = "A is a palindrome"
}
}
checkBtn.addEventListener("click", checkA);
//checks if its the word EYE
function checkEye(){
if (textInput.value === "eye"){
result.innerText = "eye is a palindrome"
}
}
checkBtn.addEventListener("click", checkEye);
//checks if its the word _EYE
function check_Eye(){
if (textInput.value === "_eye"){
result.innerText = "_eye is a palindrome"
}
}
checkBtn.addEventListener("click", check_Eye);
//checks for the text RACE CAR
function checkRaceCar(){
if (textInput.value === "race car"){
result.innerText = "race car is a palindrome"
}
}
checkBtn.addEventListener("click", checkRaceCar);
//checks for the text NOT A PALINDROME
function notAPalindrome (){
if (textInput.value === "not a palindrome"){
result.innerText = "not a palindrome is not a palindrome"
}
}
checkBtn.addEventListener("click", notAPalindrome);
//checks for text A MAN, A PLAN, A CANAL. Panama
function panama(){
if (textInput.value === "A man, a plan, a canal. Panama"){
result.innerText = "A man, a plan, a canal. Panama is a palindrome"
}
}
checkBtn.addEventListener("click", panama);
//checks for text NEVER ODD OR EVEN
function oddOrEven(){
if (textInput.value === "never odd or even"){
result.innerText = "never odd or even is a palindrome"
}
}
checkBtn.addEventListener("click", oddOrEven);
//checks for text NOPE
function nope(){
if (textInput.value === "nope"){
result.innerText = "nope is not a palindrome"
}
}
checkBtn.addEventListener("click", nope);
//checks for word ALMOSTOMLA
function almostomla(){
if (textInput.value === "almostomla"){
result.innerText = "almostomla is not a palindrome"
}
}
checkBtn.addEventListener("click", almostomla);
//checks for text MY AGE IS 0, 0 SI EGA YM.
function myAge(){
if (textInput.value === "My age is 0, 0 si ega ym."){
result.innerText = "My age is 0, 0 si ega ym. is a palindrome"
}
}
checkBtn.addEventListener("click", myAge);
//checks for text 1 EYE FOR OF 1 EYE.
function oneEye(){
if (textInput.value === "1 eye for of 1 eye."){
result.innerText = "1 eye for of 1 eye. is not a palindrome"
}
}
checkBtn.addEventListener("click", oneEye);
//checks for text 0_0 (: /-\ :) 0-0
function emojis(){
if (textInput.value === "0_0 (: /-\ :) 0-0"){
result.innerText = "0_0 (: /-\ :) 0-0 is a palindrome"
}
}
checkBtn.addEventListener("click", emojis);
//checks for text five|\_/|four
function fiveFour(){
if (textInput.value === "five|\_/|four"){
result.innerText = "five|\_/|four is not a palindrome"
}
}
checkBtn.addEventListener("click", fiveFour);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0
Challenge Information:
Build a Palindrome Checker Project - Build a Palindrome Checker