Learn HTML DOM
Browser Events
5.2
Lesson

Browser Events

Look at the code given below:

As you can see, we have no control over when the size of the first heading changed. On the other hand, the second heading changes when we click on the buttons.

It doesn’t have to be just clicks though. We can make it so that when the user hovers over the headings, their size changes. Or that the change occurs when the user presses a certain key on the keyboard, There are many ways in which we can achieve this. All these are called events.