I want to remove each child div inside a parent div using for loop something like this:
for (var x = 0; x < parent.length; x++) {
parent[x].remove();
}
Here's my code for reference:
var remove5 = document.getElementById('social');
<div class="col-md-4" id="col-md-4" id="social">
<div class="footer-col" id="footer-col">
<h4>Social Media</h4>
<span class="fa-stack">
<a href="#your-link">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-facebook-f fa-stack-1x"></i>
</a>
</span>
<span class="fa-stack">
<a href="#your-link">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-twitter fa-stack-1x"></i>
</a>
</span>
<span class="fa-stack">
<a href="#your-link">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-google-plus-g fa-stack-1x"></i>
</a>
</span>
<span class="fa-stack">
<a href="#your-link">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-instagram fa-stack-1x"></i>
</a>
</span>
<span class="fa-stack">
<a href="#your-link">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-linkedin-in fa-stack-1x"></i>
</a>
</span>
</div>
</div>
so, I want to remove all divs inside the first di with the Id social