3 ms·
You can run the following snippet in the console: function getMaxNestLevel() { var i = 1, sel = '* > *'; /* html > body is always present */
by nicoburns 4y ago
You can run the following snippet in the console:
function getMaxNestLevel() {
var i = 1, sel = '* > *'; /* html > body is always present */
while(document.querySelector(sel)) {
sel += ' > *';
i++;
}
return i;
}
console.log('total nodes', document.getElementsByTagName('*').length);
console.log('max nest level', getMaxNestLevel());