JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Javascript Palindrome Checker


About
Simple javascript that allows you to check whether a given word / string is a Palindrome or not. A palindrome is a word or phrase which reads the same forward or reverse direction.


Features
a) Used to reverse the string and check the given word is palindrome or not.
b) The checker returns true or false upon comparision.
c) The script considers spaces, punctuation marks, upper and lower cases.

Demo Checker

Enter a word:
Is the word a palindrom?
©hscripts.com


Code
Javascript Code
<!-- Script by hscripts.com -->
<!-- Copyright of HIOXINDIA -->
<!-- More scripts @www.hscripts.com -->
<script type="text/javascript">
function reverse_string(str){
  var  stri = "";
  var  alen = str.length;
  for (var i = alen ; i > 0 ; i--){
        stri += str.charAt(i-1)
   }
  return stri;
}
function palindrome(str){
         return (str == reverse_string(str));
}
function palindrome_check(){
  var str = document.getElementById('inputstr').value;
  document.getElementById('reversestr').value=reverse_string(str);
  document.getElementById('ispalin').value=palindrome(str);
  return true;
}
</script>

<!-- Script by hscripts.com -->

HTML Code
<table align=center style='border:1px solid green;color: #3D366F;font-size:13px;' cellpadding=5 cellspacing=5>
<tr><td>Enter the word:<input type="text" id="inputstr" size="6"></td></tr>
<tr><td><input type="button" value="Reverse Word" onclick="palindrome_check();"><input type="text" id="reversestr" size="6""></td></tr>
<tr><td>Is the word a palindrom?<input type="text" id="ispalin" size="4" value=""></td></tr>
<tr><td align=center><a href='http://hscripts.com' style='text-decoration:none;font-size:10;color:green;'>&copy;hscripts.com</a></td></tr>
</table>

Release Date - 18-09-2009
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
 a) Copy and paste the javascript code into your HTML page to enable word checker.
 b) Here, the function "palindrome_check()" is used to reverse and check the given string is palindrome or not.



License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting