Tell us what’s happening:
I haven’t fully completed this assignment yet, but when I click to see if I have at least completed some of the early steps nothing is returning as completed including for example the ‘input’ with an ‘id’ of “text-input” step which I am sure I have? Could someone please tell me where I have gone wrong or what is happening?
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"> <title>Palindrome-Checker</title> <link rel="stylesheet" href="styles.css">
</head>
<body>
<form>
<input type="text" id="text-input" placeholder="Enter text to check">
<button id="check-btn" type="button">Check</button>
</form>
<div id="result"></div> <script src="./script.js"></script>
</body>
/* file: styles.css */
/* file: script.js */
;
const checkButton = document.getElementById("check-btn");
const result = document.getElementById("result");
function checkInput() { const textInput = document.getElementById("text-input")
if (textInput.trim().length === 0) {alert("Please input a value")};}
function palindrome(str)
const re = /[\w_]/g;
const lowRegStr = str.toLowerCase().replace(re, '')
const reverseStr = lowRegStr.split('').reverse('').join('');
return lowRegStr === reverseStr;
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 Edg/131.0.0.0
Challenge Information:
Build a Palindrome Checker Project - Build a Palindrome Checker