I want to remove div inside the div with class chartsbar Here is my html code
<div class="chartsbar" style="position: absolute; bottom: 0px; left: 27.28%; display: none; height: 0%; background-color: rgb(7, 134, 205); color: rgb(255, 255, 255); width: 0.9730252100840335%; text-align: left; " rel="0" title="09-09-2012 - 0 (0%)">
<div style="text-align:center">
0
</div>
<span style="display: block; width: 100%; position: absolute; bottom: 0; text-align: center; background-color: #0786CD;">
09-09-2012
</span>
</div>
i tried
$('.chartsbar').find('div').first().remove();
but not seems to be working.
$('.chartsbar div').remove();
It should work!
Keep it simple!
EDIT
If you only want to remove the first one:
$('.chartsbar div:first').remove();
You can achieve this with a simple selector. This will remove the first div child.
$(".chartsbar > div:first-child").remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With