handle HTMLEvents event type, switching 'change' from UIEvent, and refactor handling for types