I’m looking for a way to remove the following empty div using jquery.
The following div is output sometimes without content inside it. For display reasons I need to remove it when it’s empty.
<div class="field-group-format group_call_to_action_aside div group-call-to-action-aside box yellow speed-fast effect-none"></div>
Thoughts?
I’ve been trying the following and variations of it, but have’t had any luck.
This works, assuming you don’t have other
div.group_call_to_action_asidethat you want to keep:Note: I’ve styled the
div, so you can see a brief flash of it before the js takes effect. but you won’t see this when you do it because thedivis empty. 😉http://jsfiddle.net/jasongennaro/L8dwn/
EDIT
Yes, as per your commment, you can also do this
$('.group_call_to_action_aside:empty').remove();http://jsfiddle.net/jasongennaro/L8dwn/1/