Created
January 26, 2012 02:46
-
-
Save anonymous/1680643 to your computer and use it in GitHub Desktop.
Lordveda - pastebin.com/UDjr6Cxd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // initialize the counter and the array | |
| var numnames = 0; | |
| var names = new Array(); | |
| function SortNames(){ | |
| // Get the name from the text field and convert it to Upper Case | |
| var thename = document.theform.newname.value; | |
| thename=thename.toUpperCase(); | |
| // Add the name to the array | |
| names[numnames] = thename; | |
| // Increment the counter | |
| numnames++; | |
| // Sort the array | |
| names.sort(); | |
| document.theform.sorted.value=names.join("\n"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment