Swap the contant of td using jquery
<p>I want to swap the content of two td's with each other by clicking on move up button.
I mean I want to swap content between the 2nd td and 3rd td.</p>

<p>I got that done but I am facing little problem in that i.e. "the swapped td's are not toggling the class that shows the current td is clicked or not after the swapping." </p>

<p>I am using this code for swapping the content of td's as below</p>

<pre><code>var currentTr = $("#selectedTab td.backgroundcolor").parent();

var previousTr = currentTr.prev();

var temp = currentTr.html();

$(currentTr).html(previousTr.html());

$(previousTr).html(temp);
</code></pre>
