Explore BrainMass

A Recursive Javascript Function to Detect Palindromes

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Please see the attached file.

Design and implement a Web page named pal.html that tests whether a word or phrase is a palindrome. Your page should allow the user to enter a word or phrase and then display a string indicating whether that word or phrase is a palindrome. The code that evaluates the user's input should be case insensitive and should ignore any non-letters within the string. Thus, the following words and phrases would all be considered palindromes:

Able was I ere I saw Elba.
A man; a plan; a canal; Panama!

The choice of page elements (e.g., test boxes, buttons, text areas) and their layout is up to you, but the overall design should be intuitive and user friendly.

© BrainMass Inc. brainmass.com March 21, 2019, 4:47 pm ad1c9bdddf


Solution Preview

Before checking to see if the entered text is a palindrome or not we need to strip all of the non-letter characters and convert all letters to lower case. Once that is done we can do the actual palindrome ...

Solution Summary

This solution shows how to create a recursive Javascript function to identify palindromes. See attachment.