I have a number of elements after a certain class that are empty or have a space inside it.
<div class="post-content">
<div class="slider-1-smart">
--- contents of the slider ---
</div>
<div></div>
<div> </div>
<ul>
<li>Text 1</li>
<li>Text 2</li>
<li>Text 3</li>
</ul>
</div>
This is the code I've tried so far:
$(function() {
$('.post-content > div:empty').each(function() {
j(this).remove();
});
});
The result of this code is that the slider container also disappears. How can I select elements after class = "slider-1-smart" and delete it
Please let me know thanks
source
share