attaches multiple events to a DOM element