title: Sorting values in ascending and descending using jquery
body: <pre><code>$1 = 10;
  $2 = 30;
  $3 = 5;
  
  $("#bidtmp").val('');
  
  if ($1 &gt; $2) {
      $("#bidtmp").val('1');
  } else if ($2 &gt; $3) {
      $("#bidtmp").val('2');
  } else if ($3 &gt; $1) {
      $("#bidtmp").val('3');
  } else if ($1 &gt; $3) {
      $("#bidtmp").val('1');
  } else if ($2 &gt; $1) {
      $("#bidtmp").val('2');
  } else if ($3 &gt; $2) {
      $("#bidtmp").val('3');
  }
  </code></pre>
  
  <p>how to sort values in ascending order using jquery? Above is the code what i have tried?</p>