【JS】Intermediate2:Events and Callbacks

event-driven :waiting for and reacting to events

2.page loads, user interacts (clicks, hovers, changes) ,triggered manually

3.A group of the things needed to listen for an event; the callback function, an element and the call to listen for an event:

【JS】Intermediate2:Events and Callbacks

addEventListener is a method found on all DOM elements

    Called on element saved in the button variable

    The name of the event to listen for='click'

    Callback function 

【JS】Intermediate2:Events and Callbacks

你可能感兴趣的:(callback)