JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<div class="remove">
<input class="remove" type="radio" id="rad1" />
<img src="img.gif" class="remove">
<div class="remove">
</div>
</div>
<div class="remove">
<input class="remove" type="radio" id="rad1" />
<img src="img.gif" class="remove">
<div class="remove">some text here 2
</div>
</div>
<div class="remove">
<input type="radio" id="rad1" />
<img src="img.gif" class="remove">
<div class="remove">some text here 3
</div>
</div>
JavaScript
$("body > div.remove").not(":has(:not(.remove))").filter(function() {
return $(this).text().trim().length == 0;
}).remove();