About Lesson
Understanding the Event Object
The event object contains details about the event.
- e.target: Refers to the element that triggered the event.
- e.type: The type of event (e.g., click, hover).
JavaScript
$("#button").click(function (e) {
console.log("Event Type: " + e.type);
console.log("Target Element: ", e.target);
});