Sort table rows based on their Class Names
<p>I want to rearrange table rows based on their Class names.<br>
Below is my HTML code.    </p>

<pre><code>&lt;table&gt;
 &lt;tr class="a4"&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;
 &lt;tr class="a6"&gt;&lt;td&gt;6&lt;/td&gt;&lt;/tr&gt;
 &lt;tr class="a1"&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
 &lt;tr class="a2"&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
 &lt;tr class="a5"&gt;&lt;td&gt;5&lt;/td&gt;&lt;/tr&gt;
 &lt;tr class="a3"&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>So now,  with class name a1 should display first, likewise a2 second.. etc..</p>

<p>Please someone help me</p>
