I have a problem regarding jQuery selector, where I have a Table structure as below (HTML Portion), and there is a link in table column for click and move the Table Row "UP" and "Down" by using jQuery (jQuery Portion, reference from this post).jQuery Portion : $(".up,.down").click(function() { var row = $(this).parents("tr:first"); if ($(this).is(".up")) { row.insertBefore(row.prev("tr:has(td)")); } else { row.insertAfter(row.next()); }});HTML Portion : <table cellspacing="0" border="0" id="Table1" style="text-align:center" > <tr> <th scope="col" width="80px">Column A</th><th scope="col" width="80px">Column B</th><th scope="col"> </th> </tr> <tr> <td> <span id="GridView1_ctl02_lbl1">A</span> </td><td> <span id="GridView1_ctl02_lbl2">0</span> </td><td> <a href="http://stackoverflow.com/questions/15584265/#" class="up">Up</a> <a href="http://stackoverflow.com/questions/15584265/#" class="down">Down</a> </td> </tr><tr> <td> <span id="GridView1_ctl03_lbl1">B</span> </td><td> <span id="GridView1_ctl03_lbl2">2</span> </td><td> <a href="http://stackoverflow.com/questions/15584265/#" class="up">Up</a> <a href="http://stackoverflow.com/questions/15584265/#" class="down">Down</a> </td> </tr><tr> <td> <span id="GridView1_ctl04_lbl1">C</span> </td><td> <span id="GridView1_ctl04_lbl2">2</span> </td><td> </td> </tr><tr> <td> <span id="GridView1_ctl05_lbl1">D</span> </td><td> <span id="GridView1_ctl05_lbl2">2</span> </td><td> </td> </tr><tr> <td> <span id="GridView1_ctl06_lbl1">E</span> </td><td> <span id="GridView1_ctl06_lbl2">3</span> </td><td> <a href="http://stackoverflow.com/questions/15584265/#" class="up">Up</a> <a href="http://stackoverflow.com/questions/15584265/#" class="down">Down</a> </td> </tr></table>I wanted the Row to be move "UP" and "Down" group by values in "Column B" (as per highlighted with red box") instead of ordinary row by row. Based on example of the diagram, the moving of rows should be move by the red boxes.So my question is, how can I using jQuery selector to select rows group by value in "Column B"? which the onclick event was trigger on links ("Up" & "Down") click.Thank you in advanced