我有这张桌子:
<table border="0" class="tab_cadrehov">
<tbody>
<tr class="tab_bg_1">
<td valign="top"><a id="User_245_245" href="/dailyTickets/front/contacts.form.php?id=245">Gov0N</a></td>
<td valign="top">ContactName</td>
<td valign="top"><a href="mailto:ContactUser@gmail.com">ContactUser@gmail.com</a></td>
</tr>
<tr class="tab_bg_2">
<td valign="top"><a id="User_695_695" href="/dailyTickets/front/contacts.form.php?id=695">iLgOP</a></td>
<td valign="top">ihi</td>
<td valign="top"><a href="mailto:yassYassine@gmail.com">yassYassine@gmail.com</a></td>
</tr>
</tbody>
</table>
我想要的是删除 ( tr
, table
) 中每个第一个 td 中的 a 元素,然后将删除的 a 元素赋予( , ) 中的第二个td
元素,如下所示:tr
table
<tr class="tab_bg_1">
<td valign="top">Gov0N</td> // delete the a element from here , but keep the inside text
<td valign="top"><a id="User_245_245" href="/dailyTickets/front/contacts.form.php?id=245">ContactName</a></td> // add it here , around the text
.........
</tr>
<tr class="tab_bg_2">
<td valign="top">iLgOP</td>
<td valign="top"><a id="User_695_695" href="/dailyTickets/front/contacts.form.php?id=695">ihi</a></td>
.....
</tr>