我有这个页面:
<div class="products">
<div id="product-1" class="product">
<a href="#" title="View this" class="product-a">
<img class="product-img" src="/product.png" alt="Image of this product" /><span class="stilt"></span>
<div class="product-info">
<h3 class="product-title"><span>This Product</span></h3>
<p class="product-price"><span>Product price</span></p>
</div>
</a>
</div>
<div id="product-2" class="product">
<a href="#" title="View this" class="product-a">
<img class="product-img" src="/product.png" alt="Image of this product" /><span class="stilt"></span>
<div class="product-info">
<h3 class="product-title"><span>This Product</span></h3>
<p class="product-price"><span>Product price</span></p>
</div>
</a>
</div>
...
</div>
我想知道是否有办法通过 .product-info.product-title 使用 javascript 升序或降序对 product-# div 进行排序,我该怎么做?