Palindrome Check

Checks if entered text is a palindrome.

by Uzair Mehmood

HTML

<label for="input">Text to check if Palindrome</label>
<input type="text" id="input" />
<hr>
<p id="output"></p>

JavaScript

$("#input").change(function () {

    if (($(this).val().split("").reverse().join("")) == $(this).val()) {
        $("#output").text("Entered text is a Palindrome !");
    } else {
        $("#output").text("Entered text is not a Palindrome!");
    }

});