「delete.png」ではないすべての画像を見つけ、その画像をsrc
「active.png」に変更します。
$("img.sign[src!='delete.png']").attr({ 'src': 'active.png', 'alt': 'Active' });
<p>
画像を変更したら、その下のテキストも「アクティブ」に変更したいと思います。
前:
<td class="TableTD">
<p style="display:inline;" class="yellow" title="<p style='margin-top:0px;font-
size:12px;margin-bottom:0px;padding-bottom:0px'>Active</p>">
<img alt="Active" src="active.png" class="sign"/>
</p></td>
<td class="TableTD">
<p style="display:inline;" class="yellow" title="<p style='margin-top:0px;font-
size:12px;margin-bottom:0px;padding-bottom:0px'>Pause</p>">
<img alt="Pause" src="pause.png" class="sign"/>
</p></td>
<td class="TableTD">
<p style="display:inline;" class="yellow" title="<p style='margin-top:0px;font-
size:12px;margin-bottom:0px;padding-bottom:0px'>Delete</p>">
<img alt="Delete" src="delete.png" class="sign"/>
</p></td>
後:
<td class="TableTD">
<p style="display:inline;" class="yellow" title="<p style='margin-top:0px;font-
size:12px;margin-bottom:0px;padding-bottom:0px'>Active</p>">
<img alt="Active" src="active.png" class="sign"/>
</p></td>
<td class="TableTD">
<p style="display:inline;" class="yellow" title="<p style='margin-top:0px;font-
size:12px;margin-bottom:0px;padding-bottom:0px'>Active</p>">
<img alt="Active" src="active.png" class="sign"/>
</p></td>
<td class="TableTD">
<p style="display:inline;" class="yellow" title="<p style='margin-top:0px;font-
size:12px;margin-bottom:0px;padding-bottom:0px'>Delete</p>">
<img alt="Delete" src="delete.png" class="sign"/>
</p></td>
私は次のようなものを書くことを考えました:
$("td.TableTd p").innerHTML = 'Active'
しかし、それは最後のtdを変更します..
アップデート:
例えば:
<p style="display:inline;" class="yellow" title="<p style='margin-top:0px;font-
size:12px;margin-bottom:0px;padding-bottom:0px'>Pause</p>">
私は言葉を変えたい:Pause
なるActive