Reversing a String
<html> <head> <SCRIPT LANGUAGE="JavaScript1.2"> function revString(str) { var retStr = ""; for (i=str.length - 1 ; i > - 1 ; i--){ retStr += str.substr(i,1); } return retStr; } </head> <body> <form> <INPUT type=button value="Reverse String" onClick="document.theForm.results.value = revString(document.theForm.inStr.value)";> </form> </body> </html>