jQuery: swap

more at: https://github.com/monolithed/jQuery-Plugins/tree/master/%24.fn.swap

by Nasser Ali Karimi

HTML

<input type="button" value="click" />
<p class="one">Regular price</p>
<p class="two">Sale price</p>

JavaScript

/**
 * Swap an element with another one
 **
 **/

$('input').click(function () {
    $(".one").before($(".two"));
});