我有一个html代码:
<table id="table1" border="0" cellspacing="0" cellpadding="3" width="1" align="center">
<tr>
<td>
<img src="http://vnexpress.net/Files/Subject/3b/bd/ac/f9/cuongbibat.jpg" width="330" height="441" border="1" alt="Cường">
</td>
</tr>
<tr>
<td class="Image">Everything
</td>
</tr>
</table>
<table id="table2" border="0" cellspacing="0" cellpadding="3" width="1" align="center">
<tr>
<td>
Someone
</td>
</tr>
<tr>
<td class="Image">Everything
</td>
</tr>
</table>
我有 2 个表,我想删除所有标签:表、tr、td 如果表有 img 标签(表 1)。我需要得到如下结果:
<img src="http://vnexpress.net/Files/Subject/3b/bd/ac/f9/cuongbibat.jpg" width="330" height="441" border="1" alt="Cường">
Everything
<table id="table2" border="0" cellspacing="0" cellpadding="3" width="1" align="center">
<tr>
<td>
Someone
</td>
</tr>
<tr>
<td class="text">Everything
</td>
</tr>
</table>
请帮我。谢谢你。