Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program to check whether a given number is a
palindrome or not?

Answer Posted / upendar

This Script checks the given number as well as string is palindrome or not


<html>
<body>
<script type="text/javascript">
function checkPalindrome() {
var revStr = "";
var str = document.getElementById("str").value;
var i = str.length;
for(var j=i; j>=0; j--) {
revStr = revStr+str.charAt(j);
}
if(str == revStr) {
alert(str+" -is Palindrome");
} else {
alert(str+" -is not a Palindrome");
}
}
</script>
<form >
Enter a String/Number: <input type="text" id="str" name="string" /><br />
<input type="submit" value="Check" onclick="checkPalindrome();"/>
</form>
</body>
</html>

Is This Answer Correct ?    437 Yes 107 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does javascript care about whitespace?

917


What are the pop-up boxes available in javascript?

921


Can javascript code be broken in different lines?

979


What can be the challenges during testing a program or a system?

2172


Why extending array is bad idea?

990


Have you used any browser for debugging? If yes, how is it done?

853


How to create an object in javascript?

1149


What are nodes in javascript?

905


What is output of “20” + 20 + 20 and “20” + ( 20 + 20)? In javascript?

967


what is the difference between wrappers and primitives es: diff between int i=200 in primitives and integeri = new integer(54)

2294


What are the data types available in javascript? Explain

903


What do you mean by script?

841


What is a javascript symbol?

878


What is unobtrusive javascript? How to add behavior to an element using javascript?

936


How do I turn on javascript on my phone?

855