Javascript/javascript logic


Harshad Raval wrote at 2013-02-25 04:43:42
Simple program for Palindrome::





Developed By - Harshad Raval (CS-1137)</br></br>

<script type="text/javascript">

 function Palindrome() {

  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");




<form >

 Enter a String/Number: <input type="text" id="str" name="string" /><br />

 <input type="submit" value="Check" onclick="Palindrome();"/>





All Answers

Ask Experts


Randy L. Taylor


I can answer advanced questions concerning most aspects of web programming including HTML, DHTML, DOM, JavaScript, Cookies, Internet Explorer, and CSSs. I can answer basic questions concerning XML and ActiveX. I can also answer questions concerning Regular Expressions, logical design algorithms, and Object Oriented Programming.


Past/Present clients
Upp Business Systems, LLC
Headquarters Standard Systems Group, USAF

©2017 All rights reserved.

[an error occurred while processing this directive]