javascript event listener element added code example
Example 1: javascript addeventlistener
//with jQuery
$("#id / .class").on('click', function(){
console.log("click");
});
Example 2: js add event listener
function eventHandler(event) {
if (event.type == 'fullscreenchange') {
/* gestire un interruttore a schermo intero */
} else /* fullscreenerror */ {
/* gestire un errore di commutazione a schermo intero */
}
}