Following is the class which is repeated:
<div class="inner">
<p>
Text1
<span class="plus"> 25</span>
<span class="minus">12</span>
</p>
</div>
<div class="inner">
<p>
Text2
<span class="plus"> 205</span>
<span class="minus">2</span>
</p>
</div>
I have two href tags to act as sort button:
<a href="#" id="pos">Sort by Positive.</a>
<a href="#" id="neg">Sort by Negative.</a>
Through jQuery, how can I re-render the dom, with the <p> sorted based on the button click?
The fiddle is located here.
Something like:
http://jsfiddle.net/pHyDm/8/
Though the two functions are basically the same and could/should probably be refactored a bit.