Define customevent object in element