Learn HTML DOM
Browser Events
5.4
Lesson

Event Handler Properties

There is another way we can handle events in JavaScript.

Take the cursor over to the brown rectangle in the example given below:

A DOM object that creates an event will have a property to handle that event. In this example, the div element listens for the mouseover event and hence has a property onmouseover that we can control. You can try this for any event.