nntrn
12/9/2018 - 9:33 PM

[DOM children] find out how many children an element has #js

[DOM children] find out how many children an element has #js

document.getElementById("myDIV").children.length;

function children() {
    var c = document.getElementById("myDIV").children.length;
    return c;
}