Hello I am trying to make my result element display “A is a palindrome” when only “A” is entered into the field and “check-btn” is clicked I believe my way would work but to no avail please help.
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html>
<head>Palindrome Checker </head>
<body>
<input id="text-input">
<button id="check-btn" ></button>
<div id="result"></div>
<script src="./script.js"></script>
</body></html>
/* file: styles.css */
/* file: script.js */
const btnChecker= document.getElementById("check-btn")
const txtinput = document.getElementById("text-input")
const result = document.getElementById("result")
const e = btnChecker.length
btnChecker.addEventListener(
"click", (e=0) => alert("please input a value"))
if(txtinput==="A" && btnChecker.clicked)
{result.innerText = "A is a palindrome"}
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 OPR/107.0.0.0
Challenge Information:
Build a Palindrome Checker Project - Build a Palindrome Checker