title: Displaying multiple html text box values in an ascending order
body: <p>I am using a HTML page where I have multiple textbox inputs, lets say five for example. I have a submit button. Once I enter all values in the text boxes and hit submit, i want all the values to be displayed in the area below submit button on the document in an ascending order. I want to sort all the values to display as result. I just used an array to test if my concept is right, but no luck. Anyone could help is highly appreciated. </p>
  
  <p>This is the code: </p>
  
  <pre><code>function myFunction() {
      var txt = new array[];
      var txt[0] = $('input:text[name=text1]').val();
      var txt[1] = $('input:text[name=text2]').val();
      var txt[2] = $('input:text[name=text3]').val();
      var txt[3] = $('input:text[name=text4]').val();
      var txt[4] = $('input:text[name=text5]').val();
      txt.sort();
      for (var i = 0; i &lt; txt.length; i++) {
          document.getElementById('txt[i]').value + ' ';
      }
  }
  </code></pre>