Check whether the event handler is a function