lick event listener syntax code example
Example 1: event listener javascript
document.querySelector('div').addEventListener('click', () => {
console.log('div clicked');
});
Example 2: javascript event listener
element.addEventListener("click", function(){
element.innerText = "something";
});