Find the index for an element based on it's tagname.