how to call a function on a event listener in javascript code example
Example: event listener javascript
document.querySelector('div').addEventListener('click', () => {
console.log('div clicked');
});
document.querySelector('div').addEventListener('click', () => {
console.log('div clicked');
});