Why do js events always start with on?

For example click event:

elem.onclick = function

The specification of the Promise then method:

new Promise().then(onFulfilled, onRejected)

This is a naming convention: on means execute the function when something happens .

Guess you like

Origin blog.csdn.net/qq_43220213/article/details/129739771