Get the index of a specific element within a set of elements.