如题,怎么修改下面tr中的第一个td里的img的src的值?假设tr对象为==》 obj <tr align="center" class="{$cat.level}" haschild="{$cat..has_children}" {if $cat.level > 0}style="display:none"{/if} >
<td align="left" class="first-cell" >
<img src="images/menu_plus.gif" width="9" height="9" border="0" style="margin-left:{$cat.level}em" onclick="rowClicked(this)" />
<span><a href="goods.php?act=list&cat_id={$cat.cat_id}">{$cat.cat_name}</a></span>
</td>
<td align="left" class="first-cell" >
<img src="images/menu_plus.gif" width="9" height="9" border="0" style="margin-left:{$cat.level}em" onclick="rowClicked(this)" />
<span><a href="goods.php?act=list&cat_id={$cat.cat_id}">{$cat.cat_name}</a></span>
</td>
obj.src .
用document.getElementsByTagName()也可以.
var trs = document.getElementsByTagName("tr");
for(var i = 0 ; i < trs.length ;i++){
trs[i].getElementsByTagName("td")[0].getElementsByTagName("img")[0].src = ""
}tr 里面第一个td 里面第一个img 。
这条语句起作用
--------------------------------------签名分割线-------------------------------------------------