different types of event listeners in javascript code example
Example 1: javascript eventlistener
document.addEventListener('click', () => {
});
Example 2: event listener javascript
document.querySelector('div').addEventListener('click', () => {
console.log('div clicked');
});