通过jquery修改的以下A HREF元素删除嵌套的IMG元素。
<table id="newHead" width="90%" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" style="display: none;border: 1px #000066 groove;">
<tr height="25px">
<td style="text-align: center;padding-left: 10px;"><strong style="white-space: nowrap; font-size: 12px; ">
<font color="#000066"> Report</font></strong></td>
<td> <a id="url" href="mmRep.do?action=getXLSummReport&reportId="><img align="right" hspace="850px" src="images/graph_bar/graph_Excel.jpg" width="25" height="25" border="0"> </a></td>
</tr>
</table>
此jquery删除嵌套的IMG元素( )
var newurl = $("a#url").attr("href") + reportId;
$("a#url").attr("href",newurl);
在我修改href attr值后,html变得喜欢这个,img元素消失了
<td>
<a id="url" href="mmRep.do?action=getXLSummReport&reportId=75">
</a>
</td>