Palindrome Checker Lab
In this lab, you will create a simple web application to check if a given string is a palindrome. A palindrome is a string that reads the same forwards and backwards (ignoring spaces, punctuation, and capitalization). You'll create an input field with id inputString
for the user to enter a string, a button with id checkPalindrome
to trigger the check, and a paragraph with id result
to display the result. You will implement a JavaScript function isPalindrome(string)
that takes a string as an argument, normalizes it (ignoring spaces, punctuation, and capitalization), and returns a boolean value indicating if the input string is a palindrome or not. When the user clicks on the checkPalindrome
button, the application should call the isPalindrome
function and display the result in the result
paragraph.
This lab will help you practice HTML, CSS, and JavaScript concepts, particularly working with strings and manipulating the DOM. Good luck!