Tell us what’s happening:
Been stuck for days on this step. I’ve looked on MDN, W3, everywhere. I can’t see what I’m doing wrong. Any help is appreciated.
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<script src="script.js"></script>
</head>
<body>
<input id="text-input" type="text" required />
<button id="check-btn"></button>
<div id="result"></div>
<script src="script.js"></script>
</body>
</html>
/* file: script.js */
const checkButton = document.getElementById("check-btn");
const textInput = document.getElementById("text-input");
checkButton.addEventListener("click", () => {
if ("text-input" === "") {
alert("Please input a value")}
});
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Challenge Information:
Build a Palindrome Checker Project - Build a Palindrome Checker