First step on Palidrome checker need help

Can anyone help me pass the first step where I can check the value of the string is empty?

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css">
<script src="script.js"></script>
<title>Build a Palindrome Checker</title>
</head>
<body>
<div id="main">
<h1>Palindrome Checker</h1>
<input id="text-input" />
<button id="check-btn">Check</button>
<p id="result"></p>
<div>
</body>
</html>```

const textInput = document.getElementById('text-input');
const checkBtn = document.getElementById('check-btn');

checkBtn.addEventListener('click', checkVal);
function checkVal() {
  if (textInput.value === "") {
    alert("Please input a value");
  }
}

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Thank you for the announcement.

Welcome back to the forum @bassettr86

Try placing the script element above the body closing tag.

Happy coding