So first main
has only one child which is why I selected the child blades as var blades = main.children[0];
then I am trying to loop through and just eliminate the children within blades
from [3] through [7] but for some reason when doing this on the console it won’t work.
function deleteBlades() {
var main = document.getElementById("id-9a1e3f8f48548d4c2c422b1f92cb749a");
var blades = main.children[0];
for (var i = 0; i < blades.length; i++) {
if( i >= 3 || i <= 7)
{
blades.children[i].remove();
}
}
}
deleteBlades();
Any ideas on what am I doing wrong?