+ 8
What exactly are "Event Listeners" and how do they work (HTML - JS)?
2 odpowiedzi
+ 1
Event listeners are callbacks functions that you attach to some DOM node and have listen for some event. For example, you might have an event listener that ways for your button to be clicked. You can have multiple event listeners for the same event on the same node which can be very helpful.
0
Event listener is simply a function that you want to run when some event happens. For example you many want to change the background by clicking on a button. For this, you bind an event listener to that button for "click" event. On click, event listener will run.