Consider a huge DOM with about 10,000 HTML elements, between them, a 1,000 span
tags.
Basically no span
has any identifier and all nested deep inside other objects having a very long Xpath
which is not comfortable to work with.
Given all span
s form an array like group, starting from 0 to 999 and we want to know what is the item reference of each unit so to select, say span
1000 we'll do:
let mySpan = document.querySelector('span')[999];
Is there a way to know what is the item reference of that specific span
element (or any other element for that matter)?
I didn't find any way in the current releases of Firefox and Chrome, but maybe I missed it in the devtool or some tweak could be utilized for that.
This question is purely theoretical and asked for general knowledge, not a specific case. Thus, I have no specific code to share in this case.