Add indexed class to element