I have code to take the input of a text box and tell the user whether it is a Palindrome or not. What codes do you use to take that word and show the reversed spelling? Here is my current code:
<script type="text/javascript" language="javascript">
function checkPalindrome()
{
var revStr = "";
var str = document.info.string.value;
var i = str.length;
for(var j=i; j>=0; j--)
{
revStr = revStr+str.charAt(j);
}
if(str == revStr)
{
window.alert(str+" is Palindrome");
}
else
{
window.alert(str+" is not a Palindrome");
}
}
</script>