document.getElementById("ELEMENT_ID").addEventListener("click", function() {
//insert here the code to be executed
});
//html
<button>My Button</button>
document.querySelector("button").addEventListener('click', handlClick);
function handlClick() {
alert("I got clicked!")
}
addEventListener('click', (event) => {});
onclick = (event) => { };
function eventHandler(event) {
if (event.type == 'fullscreenchange') {
/* gestire un interruttore a schermo intero */
} else /* fullscreenerror */ {
/* gestire un errore di commutazione a schermo intero */
}
}