This is a form of programming that is based on events.
Events can be a mouse click, a keypress, etc.
When an event happens the information required is retrieved by issuing callbacks that are already registered with the element to the main server.
This kind of programming majorly follows a publish-subscribe pattern.