1document.getElementById("myBtn").addEventListener("click", function() {
2 alert("Hello World!");
3});
1document.getElementById("ELEMENT_ID").addEventListener("click", function() {
2 //insert here the code to be executed
3});
1const element = document.querySelector(".class__name");
2
3element.addEventListener("click", () => {
4 console.log("clicked element");
5});
1function eventHandler(event) {
2 if (event.type == 'fullscreenchange') {
3 /* gestire un interruttore a schermo intero */
4 } else /* fullscreenerror */ {
5 /* gestire un errore di commutazione a schermo intero */
6 }
7}