Reputation: 1194
If div .element
has specific class .block
/ <div class="element block">
then delete html node .element img
HTML:
<div class="element">
<img src="images/picture.jpg" alt="" />
<img src="images/picture.jpg" alt="" />
</div>
Want to delete img
, how to do this by Jquery?
Upvotes: 1
Views: 49
Reputation: 752
Why not something simple like that?
$('.element.block').find('img').remove();
Upvotes: 2
Reputation: 2368
$('.element.block img').remove ()
This removes only images which are in blocks with the both classes
Upvotes: 2