javascript - Moving an element to another location -


i want each row's first col content moved corresponding third column content. how do this? moving content parent's sibling identified colb class

<tr> <td class="move">     <div id="move-0">move me 0</div> </td> <td class="cola">     <div>cola</div> </td > <td class="colb">     <div>colb</div> </td> </tr> <tr> <td class="move">     <div id="move-1">move me 1</div> </td> <td class="cola">     <div>cola</div> </td > <td class="colb">     <div>colb</div> </td> </tr> ... 

to:

<tr> <td class="move">  </td> <td class="cola">     <div>cola</div> </td > <td class="colb">     <div>colb</div>     <div id="move-0">move me 0</div> </td> </tr> <tr> <td class="move">  </td> <td class="cola">     <div>cola</div> </td > <td class="colb">     <div>colb</div>     <div id="move-1">move me 1</div> </td> </tr> 

tia

jquery('td.move').each(function(){     var t = jquery(this);     t.parent().find('td:last').append(t.children()); }); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -