test if an attribute belong to element