Tell us what’s happening:
The test tells me I,m not using .addEventListener() for showing a message
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Palindrome Checker</title>
</head>
<body>
<h1>Is it a Palindrome?</h1>
<input id="text-input" type="text" placeholder="Escribe algo aquí...">
<button id="check-btn"></button>
<div id="result"></div>
</body>
</html>
/* file: styles.css */
/* file: script.js */
const textInput = document.querySelector("#text-input");
const checkBtn = document.querySelector("#check-btn");
const result = document.querySelector("#result");
checkBtn.addEventListener("click", () => {
if (textInput.value.trim() === "") {
alert('Please input a value');
}
});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0
Challenge Information:
Build a Palindrome Checker - Build a Palindrome Checker