Understanding element events

Events are used to call functions when users interact with elements. See Creating events.


There are two components to every event:

  • event type
  • event action.

The Event type is the user interaction that calls the function. For example, On click events call functions when buttons are clicked.
There are six event types:

  • On change events call functions when users change the value of the element.
  • On click events call functions when users click buttons.
  • On key up events call functions when users type into elements.
  • On mouse enter events call functions when users move the mouse cursor over elements.
  • On got focus events call functions when users click inside elements.
  • On lost focus events call functions when users click off previously selected elements.


The Event action is the function called by the user interaction. For example, when submit buttons are clicked the On submit function is called and the form is submitted.

There are six event actions: