how to find the index of an item in nodelist in js code example
Example 1: js find index in list
let myList = ['foo', 'bar', 'qux'];
myList.indexOf('bar'); // 1
Example 2: how to find the index of an item in nodelist in js
let nodes = document.getElementsByTagName('*');
Array.prototype.indexOf.call(nodes, document.body);