I know how to select the nth element of a certain type document.querySelectorAll('.myClass')[n]
,
but given an element myEl = document.querySelector('.myClass .myOtherClass')
,
how do I then determine its place (its "n") in the array of elements selected by document.querySelectorAll('.myClass')
?