function isPalindrome (userEntry) { str = str.toLowerCase; str = str.replace(/[^a-z]/g, ""); str = (i = 0 || i Your word is not a palindrome
"; } } document.getElementById("output").innerHTML = "Your word is a palindrome
"; } <h2>Palindrome detection</h2>
<code>Detect if a string is a palindrome</code><br /><br />
Enter a word with 10 or less characters <input type="text" id="userEntry"><br />
<button type="button" onclick="isPalindrome();">Enter</button><br /><br />
</body>