Reputation: 337
I want to remove all <br>
tags in the div class category alternate
but for some reason I can't get it work.
Here is what I got so far:
$('div.category alternate').find('br').remove();
Upvotes: 1
Views: 2204
Reputation: 9305
If your HTML looks like this:
<div class="category alternate">
whatever<br>
</div>
then you want this:
$('div.category.alternate br').remove();
On the other hand, if your HTML looks like this:
<div class="category">
<div class="alternate">
whatever<br>
</div>
</div>
then you want this:
$('div.category .alternate br').remove();
Upvotes: 6
Reputation: 2265
$('div.category alternate')
tries to find all alternate
tags inside div
with class category
. Maybe you ment $('div.category .alternate')
Upvotes: 2