Return to Snippet

Revision: 4605
at January 13, 2008 13:16 by darkphotn

Initial Code
<head><title>Javascript Sort</title</head>

<script language="javascript">
function generate(s){
  var temp = new Array();
  temp = s.split('\n');
  var result = "";
  var i;
  for(i=0; i<temp.length; i++) {
      result += temp[i] + "\n";
  return result;


<form name="myform">
<textarea name="mytext" rows=20 cols=60>
Insert lines to sort here.
<input type="button" value="Sort!" onClick="javascript: document.myform.mytext.value = generate(document.myform.mytext.value);"><br><br>


Initial URL

Initial Description

Initial Title
Sort text in Javascript

Initial Tags

Initial Language