Manage the events of a DOM element