Cuenta los elementos infantiles JavaScript

let temp = document.getElementById('element').parentNode;
console.log(temp.children.length);
// or the following
console.log(temp.childElementCount);
Ankur