Handling DOM events in javascript.