eventElement() function