user472285 user472285 - 6 months ago 24
Javascript Question

jQuery remove a td that contains img src blank

<td>
<img width="8" height="1" src="/_layouts/images/blank.gif" alt="">
</td>


how can i remove a td that contains
<img src="/_layouts/images/blank.gif"
?

Thanks

Answer

Match a <img /> which is a child of a td using a combination of the child selector and the attribute equals selector:

$('td > img[src="/_layouts/images/blank.gif"]')

and then select it's parent using parent(), and remove it using remove();

$('img[src="/_layouts/images/blank.gif"]').parent().remove();
Comments