Explore BrainMass
Share

A Recursive Javascript Function to Detect Palindromes

This content was STOLEN 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:

Bob
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 October 24, 2018, 11:34 pm ad1c9bdddf
https://brainmass.com/computer-science/javascript/recursive-javascript-function-detect-palindromes-198098

Attachments

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.

$2.19