The NodeList don\'t have a indexOf(element) method? So, how can I get the element index?
You can use Array.prototype.indexOf.call() like this
Array.prototype.indexOf.call()
let nodes = document.getElementsByTagName('*'); Array.prototype.indexOf.call(nodes, document.body);