how to alert javascript with an event listener code example
Example 1: javascript eventlistener
document.addEventListener('click', () => {
});
Example 2: event listener javascript
document.querySelector('div').addEventListener('click', () => {
console.log('div clicked');
});