title: Sort according to price in html using java script
body: <p>I'm having trouble in coding a java script for ascending and descending order in html. Can some one help me. here is my html part of coding</p>
  
  <pre><code>&lt;div class="content"&gt;
      &lt;!-- sorting, pages --&gt;
      &lt;div class="list_manage"&gt;
          &lt;div class="inner clearfix"&gt;
              &lt;form action="#" method="post" class="form_sort"&gt; &lt;span class="manage_title"&gt;Sort by:&lt;/span&gt;
  
                  &lt;select class="select_styled white_select" name="sort_list" id="sort_list"&gt;
                      &lt;option value="1" data-sort="ladd"&gt;Latest Added
                          &lt;option value="2" selected="" data-sort="price"&gt;Price High - Low
                              &lt;option value="3" data-sort="loc"&gt;Location
                                  &lt;!--&lt;option value="4"&gt;Names A-Z
                                  &lt;option value="5"&gt;Names Z-A--&gt;
                  &lt;/select&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;!--/ sorting, pages --&gt;
      &lt;!-- offers list --&gt;
      &lt;div class="offer_list clearfix"&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_01.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;Mercedes-Benz ML 350 BlueTEC 4MATIC 7G&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, Used vehicle, Automatic transmission, Diesel, 190 kW (258 PS), Fuel consumption combined: 6.8 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$32.690&lt;/div&gt; &lt;span class="offer_miliage"&gt;55,689 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;08/2011&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_02.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;Porsche CAYENNE S DIESEL V8 4.2&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, New vehicle, Automatic transmission, Diesel, 281 kW (382 PS), Fuel consumption combined: 14.3 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$56.300&lt;/div&gt; &lt;span class="offer_miliage"&gt;237,391 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;12/2012&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_03.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;Infiniti FX 37 AWD Aut. S Premium&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, New vehicle, Automatic transmission, Diesel, 281 kW (382 PS), Fuel consumption combined: 14.3 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$47.000&lt;/div&gt; &lt;span class="offer_miliage"&gt;27,391 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;08/2010&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_04.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;Volvo XC60 D5 AWD Aut. RE-Design&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, New vehicle, Automatic transmission, Diesel, 281 kW (382 PS), Fuel consumption combined: 14.3 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$26.750&lt;/div&gt; &lt;span class="offer_miliage"&gt;50,584 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;05/2011&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_05.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;BMW X5 Adaptive Drive Head-Up Display&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, New vehicle, Automatic transmission, Diesel, 281 kW (382 PS), Fuel consumption combined: 14.3 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$33.300&lt;/div&gt; &lt;span class="offer_miliage"&gt;15,785 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;10/2012&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_06.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;Land Rover Sport SDV6 HSE&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, New vehicle, Automatic transmission, Diesel, 281 kW (382 PS), Fuel consumption combined: 14.3 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$44.300&lt;/div&gt; &lt;span class="offer_miliage"&gt;197,391 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;07/2009&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_07.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;Audi Q7 4.2 TDI S-LINE PANORAMA&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, Used vehicle, Manual transmission, LPG &amp; DIesel, 158 kW (215 PS), Fuel consumption combined: 8.9 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$48.500&lt;/div&gt; &lt;span class="offer_miliage"&gt;18,085 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;03/2011&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="offer_item clearfix"&gt;
              &lt;div class="offer_image"&gt;&lt;a href="offers-details.html"&gt;&lt;img src="images/temp/prod_img_08.jpg" alt=""&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="offer_aside"&gt;
                      &lt;h2&gt;&lt;a href="offers-details.html"&gt;Volkswagen Touareg V6 TDI R-Line&lt;/a&gt;&lt;/h2&gt;
  
                  &lt;div class="offer_descr"&gt;
                      &lt;p&gt;Off-road Vehicle/Pickup Truck, Used vehicle, Automatic transmission, Diesel, 408 kW (555 PS), Fuel consumption combined: 15.4 l/100 km&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="offer_data"&gt;
                      &lt;div class="offer_price"&gt;$63.300&lt;/div&gt; &lt;span class="offer_miliage"&gt;7,785 KM&lt;/span&gt;
   &lt;span class="offer_regist"&gt;12/2011&lt;/span&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I want to sort it and display only high to low price and vice-versa.</p>