title: Can't get array of sorted items to show results on screen?
body: <p>In <a href="http://jsfiddle.net/AQFFq/21/" rel="nofollow">my jsfiddle</a>, I'm trying to sort the items from high to low price by calling the following function:</p>
  
  <pre><code>function myFunction() {
    var elements = [].slice.call(document.getElementsByClassName("price"));
    elements.sort(function(a, b) {
      return parseFloat(b.innerHTML.substring(1)) - parseFloat(a.innerHTML.substring(1));
    });
    for (var i = 0; i &lt; elements.length; i++)
      elements[i].parentNode.appendChild(elements[i]);
    console.log(elements);
  }
  </code></pre>
  
  <p>I can see it working when I console.log, but I can't get the results to actually appear on the screen and change the order of my items.</p>
  
  <p>I see in <a href="http://jsfiddle.net/AQFFq/2/" rel="nofollow">this fiddle</a> with the below JavaScript, it works, why doesn't mine?</p>
  
  <pre><code> $(function() {
      $(".offer_item").sort(function(a, b) {
          var priceAText = $(a).find(".offer_price").text();
          var priceBText = $(b).find(".offer_price").text();
          var priceA = parseFloat(priceAText.substring(1, priceAText.length));
          var priceB = parseFloat(priceBText.substring(1, priceBText.length));
          return priceA &gt; priceB;
      }).each(function() {
        $(this).appendTo(".offer_list");
      });
  });
  </code></pre>