title: Sorting words according to length in textarea using html & javascript
body: <pre><code>&lt;div  align="center"&gt;
      &lt;textarea style="overflow:auto;resize:none" id="sorter3" name="sorter3" rows="4" cols="50" maxlength="100" wrap="hard"&gt;&lt;/textarea&gt;&lt;br&gt;
      &lt;input type="button" value="words in Asc" onClick="SortWords()"&gt;                  
  &lt;/div&gt;       
  </code></pre>
  
  <p>This is my html page for that corresponding javascript is:</p>
  
  <pre><code>function SortWords(){
      var inputvalues=document.getElementById("sorter3").value.split("");   
      inputvalues.sort();       
      //alert(inputvalues)
      alert(inputvalues[0])
      document.getElementById("sorter3").value=inputvalues;       
  }
  </code></pre>
  
  <p>it is showing the output based on words initials but i need output based on length:<br>
  example: when i enter some thing in text area as : welcome to javascriptworld it is a independent langauage, expected output is : smallest word is 'a' and longest word is 'javascriptworld' can anybody help me how to do this</p>