Reputation: 4869
I have some table
<table>
<tr class="trclass">
<td class ="tdc">
<img src="/images/products/nophoto_s.jpg">
</td>
</tr>
</table>
How to remove table row if img src tag not include nophoto_s.jpg ?
Upvotes: 1
Views: 1400
Reputation: 83358
filter
can take a function allowing you to specify any condition you'd like. Use this, with find
, to grab all table rows that have an image with nophoto_s.jpg
as the src
, then remove them.
$("tr").filter(function() {
return $(this).find("img[src*='nophoto_s.jpg']").length > 0;
}).remove();
Here's a fiddle
Upvotes: 1